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
op4j/op4j
src/main/java/org/op4j/functions/Call.java
Call.shr
public static Function<Object,Short> shr(final String methodName, final Object... optionalParameters) { """ <p> Abbreviation for {{@link #methodForShort(String, Object...)}. </p> @since 1.1 @param methodName the name of the method @param optionalParameters the (optional) parameters of the method. @return...
java
public static Function<Object,Short> shr(final String methodName, final Object... optionalParameters) { return methodForShort(methodName, optionalParameters); }
[ "public", "static", "Function", "<", "Object", ",", "Short", ">", "shr", "(", "final", "String", "methodName", ",", "final", "Object", "...", "optionalParameters", ")", "{", "return", "methodForShort", "(", "methodName", ",", "optionalParameters", ")", ";", "}...
<p> Abbreviation for {{@link #methodForShort(String, Object...)}. </p> @since 1.1 @param methodName the name of the method @param optionalParameters the (optional) parameters of the method. @return the result of the method execution
[ "<p", ">", "Abbreviation", "for", "{{", "@link", "#methodForShort", "(", "String", "Object", "...", ")", "}", ".", "<", "/", "p", ">" ]
train
https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/functions/Call.java#L488-L490
Azure/azure-sdk-for-java
datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/TrustedIdProvidersInner.java
TrustedIdProvidersInner.createOrUpdateAsync
public Observable<TrustedIdProviderInner> createOrUpdateAsync(String resourceGroupName, String accountName, String trustedIdProviderName, CreateOrUpdateTrustedIdProviderParameters parameters) { """ Creates or updates the specified trusted identity provider. During update, the trusted identity provider with the spe...
java
public Observable<TrustedIdProviderInner> createOrUpdateAsync(String resourceGroupName, String accountName, String trustedIdProviderName, CreateOrUpdateTrustedIdProviderParameters parameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, trustedIdProviderName, parameters).map(n...
[ "public", "Observable", "<", "TrustedIdProviderInner", ">", "createOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "accountName", ",", "String", "trustedIdProviderName", ",", "CreateOrUpdateTrustedIdProviderParameters", "parameters", ")", "{", "return", "...
Creates or updates the specified trusted identity provider. During update, the trusted identity provider with the specified name will be replaced with this new provider. @param resourceGroupName The name of the Azure resource group. @param accountName The name of the Data Lake Store account. @param trustedIdProviderNa...
[ "Creates", "or", "updates", "the", "specified", "trusted", "identity", "provider", ".", "During", "update", "the", "trusted", "identity", "provider", "with", "the", "specified", "name", "will", "be", "replaced", "with", "this", "new", "provider", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/TrustedIdProvidersInner.java#L257-L264
UrielCh/ovh-java-sdk
ovh-java-sdk-cdnwebstorage/src/main/java/net/minidev/ovh/api/ApiOvhCdnwebstorage.java
ApiOvhCdnwebstorage.serviceName_statistics_GET
public ArrayList<OvhStatsDataType> serviceName_statistics_GET(String serviceName, OvhStatsPeriodEnum period, OvhStatsTypeEnum type) throws IOException { """ Return stats about bandwidth consumption REST: GET /cdn/webstorage/{serviceName}/statistics @param type [required] @param period [required] @param servi...
java
public ArrayList<OvhStatsDataType> serviceName_statistics_GET(String serviceName, OvhStatsPeriodEnum period, OvhStatsTypeEnum type) throws IOException { String qPath = "/cdn/webstorage/{serviceName}/statistics"; StringBuilder sb = path(qPath, serviceName); query(sb, "period", period); query(sb, "type", type); ...
[ "public", "ArrayList", "<", "OvhStatsDataType", ">", "serviceName_statistics_GET", "(", "String", "serviceName", ",", "OvhStatsPeriodEnum", "period", ",", "OvhStatsTypeEnum", "type", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/cdn/webstorage/{serviceNam...
Return stats about bandwidth consumption REST: GET /cdn/webstorage/{serviceName}/statistics @param type [required] @param period [required] @param serviceName [required] The internal name of your CDN Static offer
[ "Return", "stats", "about", "bandwidth", "consumption" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cdnwebstorage/src/main/java/net/minidev/ovh/api/ApiOvhCdnwebstorage.java#L85-L92
spotbugs/spotbugs
spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/MainFrameComponentFactory.java
MainFrameComponentFactory.bugSummaryComponent
public Component bugSummaryComponent(String str, BugInstance bug) { """ Creates bug summary component. If obj is a string will create a JLabel with that string as it's text and return it. If obj is an annotation will return a JLabel with the annotation's toString(). If that annotation is a SourceLineAnnotation ...
java
public Component bugSummaryComponent(String str, BugInstance bug) { JLabel label = new JLabel(); label.setFont(label.getFont().deriveFont(Driver.getFontSize())); label.setFont(label.getFont().deriveFont(Font.PLAIN)); label.setForeground(Color.BLACK); label.setText(str); ...
[ "public", "Component", "bugSummaryComponent", "(", "String", "str", ",", "BugInstance", "bug", ")", "{", "JLabel", "label", "=", "new", "JLabel", "(", ")", ";", "label", ".", "setFont", "(", "label", ".", "getFont", "(", ")", ".", "deriveFont", "(", "Dri...
Creates bug summary component. If obj is a string will create a JLabel with that string as it's text and return it. If obj is an annotation will return a JLabel with the annotation's toString(). If that annotation is a SourceLineAnnotation or has a SourceLineAnnotation connected to it and the source file is available w...
[ "Creates", "bug", "summary", "component", ".", "If", "obj", "is", "a", "string", "will", "create", "a", "JLabel", "with", "that", "string", "as", "it", "s", "text", "and", "return", "it", ".", "If", "obj", "is", "an", "annotation", "will", "return", "a...
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/MainFrameComponentFactory.java#L293-L307
jenkinsci/jenkins
core/src/main/java/jenkins/util/xml/XMLUtils.java
XMLUtils.getValue
public static @Nonnull String getValue(@Nonnull String xpath, @Nonnull File file, @Nonnull String fileDataEncoding) throws IOException, SAXException, XPathExpressionException { """ The a "value" from an XML file using XPath. @param xpath The XPath expression to select the value. @param file The file to read. @p...
java
public static @Nonnull String getValue(@Nonnull String xpath, @Nonnull File file, @Nonnull String fileDataEncoding) throws IOException, SAXException, XPathExpressionException { Document document = parse(file, fileDataEncoding); return getValue(xpath, document); }
[ "public", "static", "@", "Nonnull", "String", "getValue", "(", "@", "Nonnull", "String", "xpath", ",", "@", "Nonnull", "File", "file", ",", "@", "Nonnull", "String", "fileDataEncoding", ")", "throws", "IOException", ",", "SAXException", ",", "XPathExpressionExce...
The a "value" from an XML file using XPath. @param xpath The XPath expression to select the value. @param file The file to read. @param fileDataEncoding The file data format. @return The data value. An empty {@link String} is returned when the expression does not evaluate to anything in the document. @throws IOExceptio...
[ "The", "a", "value", "from", "an", "XML", "file", "using", "XPath", "." ]
train
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/xml/XMLUtils.java#L179-L182
meltmedia/cadmium
servlets/src/main/java/com/meltmedia/cadmium/servlets/BasicFileServlet.java
BasicFileServlet.calculateRangeLength
public static Long calculateRangeLength(FileRequestContext context, Range range) { """ Calculates the length of a given range. @param context @param range @return """ if(range.start == -1) range.start = 0; if(range.end == -1) range.end = context.file.length() - 1; range.length = range.end - ra...
java
public static Long calculateRangeLength(FileRequestContext context, Range range) { if(range.start == -1) range.start = 0; if(range.end == -1) range.end = context.file.length() - 1; range.length = range.end - range.start + 1; return range.length; }
[ "public", "static", "Long", "calculateRangeLength", "(", "FileRequestContext", "context", ",", "Range", "range", ")", "{", "if", "(", "range", ".", "start", "==", "-", "1", ")", "range", ".", "start", "=", "0", ";", "if", "(", "range", ".", "end", "=="...
Calculates the length of a given range. @param context @param range @return
[ "Calculates", "the", "length", "of", "a", "given", "range", "." ]
train
https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/servlets/src/main/java/com/meltmedia/cadmium/servlets/BasicFileServlet.java#L236-L241
jmxtrans/jmxtrans
jmxtrans-output/jmxtrans-output-jrobin/src/main/java/com/googlecode/jmxtrans/model/output/RRDToolWriter.java
RRDToolWriter.checkErrorStream
private void checkErrorStream(Process process) throws Exception { """ Check to see if there was an error processing an rrdtool command """ // rrdtool should use platform encoding (unless you did something // very strange with your installation of rrdtool). So let's be // explicit and use the presumed cor...
java
private void checkErrorStream(Process process) throws Exception { // rrdtool should use platform encoding (unless you did something // very strange with your installation of rrdtool). So let's be // explicit and use the presumed correct encoding to read errors. try ( InputStream is = process.getErrorStream(...
[ "private", "void", "checkErrorStream", "(", "Process", "process", ")", "throws", "Exception", "{", "// rrdtool should use platform encoding (unless you did something", "// very strange with your installation of rrdtool). So let's be", "// explicit and use the presumed correct encoding to rea...
Check to see if there was an error processing an rrdtool command
[ "Check", "to", "see", "if", "there", "was", "an", "error", "processing", "an", "rrdtool", "command" ]
train
https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-output/jmxtrans-output-jrobin/src/main/java/com/googlecode/jmxtrans/model/output/RRDToolWriter.java#L249-L267
alkacon/opencms-core
src/org/opencms/i18n/CmsMessages.java
CmsMessages.keyDefault
public String keyDefault(String keyName, String defaultValue) { """ Returns the localized resource string for a given message key.<p> If the key was not found in the bundle, the provided default value is returned.<p> @param keyName the key for the desired string @param defaultValue the default value in cas...
java
public String keyDefault(String keyName, String defaultValue) { String result = key(keyName, true); return (result == null) ? defaultValue : result; }
[ "public", "String", "keyDefault", "(", "String", "keyName", ",", "String", "defaultValue", ")", "{", "String", "result", "=", "key", "(", "keyName", ",", "true", ")", ";", "return", "(", "result", "==", "null", ")", "?", "defaultValue", ":", "result", ";...
Returns the localized resource string for a given message key.<p> If the key was not found in the bundle, the provided default value is returned.<p> @param keyName the key for the desired string @param defaultValue the default value in case the key does not exist in the bundle @return the resource string for the give...
[ "Returns", "the", "localized", "resource", "string", "for", "a", "given", "message", "key", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/i18n/CmsMessages.java#L504-L508
mabe02/lanterna
src/main/java/com/googlecode/lanterna/terminal/IOSafeTerminalAdapter.java
IOSafeTerminalAdapter.createRuntimeExceptionConvertingAdapter
public static IOSafeTerminal createRuntimeExceptionConvertingAdapter(Terminal terminal) { """ Creates a wrapper around a Terminal that exposes it as a IOSafeTerminal. If any IOExceptions occur, they will be wrapped by a RuntimeException and re-thrown. @param terminal Terminal to wrap @return IOSafeTerminal wrap...
java
public static IOSafeTerminal createRuntimeExceptionConvertingAdapter(Terminal terminal) { if (terminal instanceof ExtendedTerminal) { // also handle Runtime-type: return createRuntimeExceptionConvertingAdapter((ExtendedTerminal)terminal); } else { return new IOSafeTerminalAdapter...
[ "public", "static", "IOSafeTerminal", "createRuntimeExceptionConvertingAdapter", "(", "Terminal", "terminal", ")", "{", "if", "(", "terminal", "instanceof", "ExtendedTerminal", ")", "{", "// also handle Runtime-type:", "return", "createRuntimeExceptionConvertingAdapter", "(", ...
Creates a wrapper around a Terminal that exposes it as a IOSafeTerminal. If any IOExceptions occur, they will be wrapped by a RuntimeException and re-thrown. @param terminal Terminal to wrap @return IOSafeTerminal wrapping the supplied terminal
[ "Creates", "a", "wrapper", "around", "a", "Terminal", "that", "exposes", "it", "as", "a", "IOSafeTerminal", ".", "If", "any", "IOExceptions", "occur", "they", "will", "be", "wrapped", "by", "a", "RuntimeException", "and", "re", "-", "thrown", "." ]
train
https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/terminal/IOSafeTerminalAdapter.java#L59-L65
aws/aws-cloudtrail-processing-library
src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/configuration/PropertiesFileConfiguration.java
PropertiesFileConfiguration.getBooleanProperty
private Boolean getBooleanProperty(Properties prop, String name) { """ Convert a string representation of a property to a boolean type. @param prop the {@link Properties} needs conversion. @param name a name to evaluate in the property file. @return a boolean representation of the value associated with the pr...
java
private Boolean getBooleanProperty(Properties prop, String name) { String propertyValue = prop.getProperty(name); return Boolean.parseBoolean(propertyValue); }
[ "private", "Boolean", "getBooleanProperty", "(", "Properties", "prop", ",", "String", "name", ")", "{", "String", "propertyValue", "=", "prop", ".", "getProperty", "(", "name", ")", ";", "return", "Boolean", ".", "parseBoolean", "(", "propertyValue", ")", ";",...
Convert a string representation of a property to a boolean type. @param prop the {@link Properties} needs conversion. @param name a name to evaluate in the property file. @return a boolean representation of the value associated with the property name.
[ "Convert", "a", "string", "representation", "of", "a", "property", "to", "a", "boolean", "type", "." ]
train
https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/configuration/PropertiesFileConfiguration.java#L292-L295
santhosh-tekuri/jlibs
core/src/main/java/jlibs/core/lang/ArrayUtil.java
ArrayUtil.concat
public static Object[] concat(Object array1[], Object array2[]) { """ Returns new array which has all values from array1 and array2 in order. The componentType for the new array is determined by the componentTypes of two arrays. """ Class<?> class1 = array1.getClass().getComponentType(); Clas...
java
public static Object[] concat(Object array1[], Object array2[]){ Class<?> class1 = array1.getClass().getComponentType(); Class<?> class2 = array2.getClass().getComponentType(); Class<?> commonClass = class1.isAssignableFrom(class2) ? class1 ...
[ "public", "static", "Object", "[", "]", "concat", "(", "Object", "array1", "[", "]", ",", "Object", "array2", "[", "]", ")", "{", "Class", "<", "?", ">", "class1", "=", "array1", ".", "getClass", "(", ")", ".", "getComponentType", "(", ")", ";", "C...
Returns new array which has all values from array1 and array2 in order. The componentType for the new array is determined by the componentTypes of two arrays.
[ "Returns", "new", "array", "which", "has", "all", "values", "from", "array1", "and", "array2", "in", "order", ".", "The", "componentType", "for", "the", "new", "array", "is", "determined", "by", "the", "componentTypes", "of", "two", "arrays", "." ]
train
https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/lang/ArrayUtil.java#L195-L202
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/view/ApptentiveNestedScrollView.java
ApptentiveNestedScrollView.pageScroll
public boolean pageScroll(int direction) { """ <p>Handles scrolling in response to a "page up/down" shortcut press. This method will scroll the view by one page up or down and give the focus to the topmost/bottommost component in the new visible area. If no component is a good candidate for focus, this scrollvi...
java
public boolean pageScroll(int direction) { boolean down = direction == View.FOCUS_DOWN; int height = getHeight(); if (down) { mTempRect.top = getScrollY() + height; int count = getChildCount(); if (count > 0) { View view = getChildAt(count - 1); if (mTempRect.top + height > view.getBottom()) { ...
[ "public", "boolean", "pageScroll", "(", "int", "direction", ")", "{", "boolean", "down", "=", "direction", "==", "View", ".", "FOCUS_DOWN", ";", "int", "height", "=", "getHeight", "(", ")", ";", "if", "(", "down", ")", "{", "mTempRect", ".", "top", "="...
<p>Handles scrolling in response to a "page up/down" shortcut press. This method will scroll the view by one page up or down and give the focus to the topmost/bottommost component in the new visible area. If no component is a good candidate for focus, this scrollview reclaims the focus.</p> @param direction the scroll...
[ "<p", ">", "Handles", "scrolling", "in", "response", "to", "a", "page", "up", "/", "down", "shortcut", "press", ".", "This", "method", "will", "scroll", "the", "view", "by", "one", "page", "up", "or", "down", "and", "give", "the", "focus", "to", "the",...
train
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/view/ApptentiveNestedScrollView.java#L1112-L1134
wkgcass/Style
src/main/java/net/cassite/style/aggregation/MapFuncSup.java
MapFuncSup.forThose
public <R> R forThose(RFunc2<Boolean, K, V> predicate, def<R> func) { """ define a function to deal with each element in the map @param predicate a function takes in each element from map and returns true or false(or null) @param func a function returns 'last loop result' @return return 'last loop value...
java
public <R> R forThose(RFunc2<Boolean, K, V> predicate, def<R> func) { Iterator<K> it = map.keySet().iterator(); IteratorInfo<R> info = new IteratorInfo<>(); ptr<Integer> i = Style.ptr(0); return Style.While(it::hasNext, (loopInfo) -> { ...
[ "public", "<", "R", ">", "R", "forThose", "(", "RFunc2", "<", "Boolean", ",", "K", ",", "V", ">", "predicate", ",", "def", "<", "R", ">", "func", ")", "{", "Iterator", "<", "K", ">", "it", "=", "map", ".", "keySet", "(", ")", ".", "iterator", ...
define a function to deal with each element in the map @param predicate a function takes in each element from map and returns true or false(or null) @param func a function returns 'last loop result' @return return 'last loop value'.<br> check <a href="https://github.com/wkgcass/Style/">tutorial</a> for more info ...
[ "define", "a", "function", "to", "deal", "with", "each", "element", "in", "the", "map" ]
train
https://github.com/wkgcass/Style/blob/db3ea64337251f46f734279480e365293bececbd/src/main/java/net/cassite/style/aggregation/MapFuncSup.java#L180-L204
intive-FDV/DynamicJasper
src/main/java/ar/com/fdvs/dj/util/LayoutUtils.java
LayoutUtils.moveBandsElemnts
public static void moveBandsElemnts(int yOffset, JRDesignBand band) { """ Moves the elements contained in "band" in the Y axis "yOffset" @param yOffset @param band """ if (band == null) return; for (JRChild jrChild : band.getChildren()) { JRDesignElement elem = (JRDesignElement) jrChild; elem.s...
java
public static void moveBandsElemnts(int yOffset, JRDesignBand band) { if (band == null) return; for (JRChild jrChild : band.getChildren()) { JRDesignElement elem = (JRDesignElement) jrChild; elem.setY(elem.getY() + yOffset); } }
[ "public", "static", "void", "moveBandsElemnts", "(", "int", "yOffset", ",", "JRDesignBand", "band", ")", "{", "if", "(", "band", "==", "null", ")", "return", ";", "for", "(", "JRChild", "jrChild", ":", "band", ".", "getChildren", "(", ")", ")", "{", "J...
Moves the elements contained in "band" in the Y axis "yOffset" @param yOffset @param band
[ "Moves", "the", "elements", "contained", "in", "band", "in", "the", "Y", "axis", "yOffset" ]
train
https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/util/LayoutUtils.java#L89-L97
geomajas/geomajas-project-client-gwt2
plugin/editing/common/src/main/java/org/geomajas/plugin/editing/client/operation/InsertVertexOperation.java
InsertVertexOperation.insertAfterEdge
private void insertAfterEdge(Geometry geom, GeometryIndex index, Coordinate coordinate) throws GeometryIndexNotFoundException { """ Insert a point into a given edge. There can be only edges if there are at least 2 points in a LineString geometry. """ // First we check the geometry type: if (!Geometry.L...
java
private void insertAfterEdge(Geometry geom, GeometryIndex index, Coordinate coordinate) throws GeometryIndexNotFoundException { // First we check the geometry type: if (!Geometry.LINE_STRING.equals(geom.getGeometryType()) && !Geometry.LINEAR_RING.equals(geom.getGeometryType())) { throw new GeometryIndexNo...
[ "private", "void", "insertAfterEdge", "(", "Geometry", "geom", ",", "GeometryIndex", "index", ",", "Coordinate", "coordinate", ")", "throws", "GeometryIndexNotFoundException", "{", "// First we check the geometry type:", "if", "(", "!", "Geometry", ".", "LINE_STRING", "...
Insert a point into a given edge. There can be only edges if there are at least 2 points in a LineString geometry.
[ "Insert", "a", "point", "into", "a", "given", "edge", ".", "There", "can", "be", "only", "edges", "if", "there", "are", "at", "least", "2", "points", "in", "a", "LineString", "geometry", "." ]
train
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/editing/common/src/main/java/org/geomajas/plugin/editing/client/operation/InsertVertexOperation.java#L111-L138
reactor/reactor-netty
src/main/java/reactor/netty/http/server/ConnectionInfo.java
ConnectionInfo.newForwardedConnectionInfo
static ConnectionInfo newForwardedConnectionInfo(HttpRequest request, Channel channel) { """ Retrieve the connection information from the {@code "Forwarded"}/{@code "X-Forwarded-*"} HTTP request headers, or from the current connection directly if none are found. @param request the current server request @param ...
java
static ConnectionInfo newForwardedConnectionInfo(HttpRequest request, Channel channel) { if (request.headers().contains(FORWARDED_HEADER)) { return parseForwardedInfo(request, (SocketChannel)channel); } else { return parseXForwardedInfo(request, (SocketChannel)channel); } }
[ "static", "ConnectionInfo", "newForwardedConnectionInfo", "(", "HttpRequest", "request", ",", "Channel", "channel", ")", "{", "if", "(", "request", ".", "headers", "(", ")", ".", "contains", "(", "FORWARDED_HEADER", ")", ")", "{", "return", "parseForwardedInfo", ...
Retrieve the connection information from the {@code "Forwarded"}/{@code "X-Forwarded-*"} HTTP request headers, or from the current connection directly if none are found. @param request the current server request @param channel the current channel @return the connection information
[ "Retrieve", "the", "connection", "information", "from", "the", "{" ]
train
https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/http/server/ConnectionInfo.java#L92-L99
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementTermListsImpl.java
ListManagementTermListsImpl.refreshIndexMethod
public RefreshIndex refreshIndexMethod(String listId, String language) { """ Refreshes the index of the list with list Id equal to list ID passed. @param listId List Id of the image list. @param language Language of the terms. @throws IllegalArgumentException thrown if parameters fail the validation @throws ...
java
public RefreshIndex refreshIndexMethod(String listId, String language) { return refreshIndexMethodWithServiceResponseAsync(listId, language).toBlocking().single().body(); }
[ "public", "RefreshIndex", "refreshIndexMethod", "(", "String", "listId", ",", "String", "language", ")", "{", "return", "refreshIndexMethodWithServiceResponseAsync", "(", "listId", ",", "language", ")", ".", "toBlocking", "(", ")", ".", "single", "(", ")", ".", ...
Refreshes the index of the list with list Id equal to list ID passed. @param listId List Id of the image list. @param language Language of the terms. @throws IllegalArgumentException thrown if parameters fail the validation @throws APIErrorException thrown if the request is rejected by server @throws RuntimeException ...
[ "Refreshes", "the", "index", "of", "the", "list", "with", "list", "Id", "equal", "to", "list", "ID", "passed", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementTermListsImpl.java#L502-L504
threerings/nenya
core/src/main/java/com/threerings/miso/client/MisoScenePanel.java
MisoScenePanel.appendDirtySprite
protected void appendDirtySprite (DirtyItemList list, Sprite sprite) { """ Computes the tile coordinates of the supplied sprite and appends it to the supplied dirty item list. """ MisoUtil.screenToTile(_metrics, sprite.getX(), sprite.getY(), _tcoords); list.appendDirtySprite(sprite, _tcoords.x...
java
protected void appendDirtySprite (DirtyItemList list, Sprite sprite) { MisoUtil.screenToTile(_metrics, sprite.getX(), sprite.getY(), _tcoords); list.appendDirtySprite(sprite, _tcoords.x, _tcoords.y); }
[ "protected", "void", "appendDirtySprite", "(", "DirtyItemList", "list", ",", "Sprite", "sprite", ")", "{", "MisoUtil", ".", "screenToTile", "(", "_metrics", ",", "sprite", ".", "getX", "(", ")", ",", "sprite", ".", "getY", "(", ")", ",", "_tcoords", ")", ...
Computes the tile coordinates of the supplied sprite and appends it to the supplied dirty item list.
[ "Computes", "the", "tile", "coordinates", "of", "the", "supplied", "sprite", "and", "appends", "it", "to", "the", "supplied", "dirty", "item", "list", "." ]
train
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L756-L760
beihaifeiwu/dolphin
dolphin-common/src/main/java/com/freetmp/common/util/PropertyPlaceholderHelper.java
PropertyPlaceholderHelper.replacePlaceholders
public String replacePlaceholders(String value, PlaceholderResolver placeholderResolver) { """ Replaces all placeholders of format {@code ${name}} with the value returned from the supplied {@link PlaceholderResolver}. @param value the value containing the placeholders to be replaced @param placeholderResolver t...
java
public String replacePlaceholders(String value, PlaceholderResolver placeholderResolver) { Assert.notNull(value, "'value' must not be null"); return parseStringValue(value, placeholderResolver, new HashSet<String>()); }
[ "public", "String", "replacePlaceholders", "(", "String", "value", ",", "PlaceholderResolver", "placeholderResolver", ")", "{", "Assert", ".", "notNull", "(", "value", ",", "\"'value' must not be null\"", ")", ";", "return", "parseStringValue", "(", "value", ",", "p...
Replaces all placeholders of format {@code ${name}} with the value returned from the supplied {@link PlaceholderResolver}. @param value the value containing the placeholders to be replaced @param placeholderResolver the {@code PlaceholderResolver} to use for replacement @return the supplied value with placeholders repl...
[ "Replaces", "all", "placeholders", "of", "format", "{" ]
train
https://github.com/beihaifeiwu/dolphin/blob/b100579cc6986dce5eba5593ebb5fbae7bad9d1a/dolphin-common/src/main/java/com/freetmp/common/util/PropertyPlaceholderHelper.java#L124-L127
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Math.java
Math.addExact
public static int addExact(int x, int y) { """ Returns the sum of its arguments, throwing an exception if the result overflows an {@code int}. @param x the first value @param y the second value @return the result @throws ArithmeticException if the result overflows an int @since 1.8 """ int r = ...
java
public static int addExact(int x, int y) { int r = x + y; // HD 2-12 Overflow iff both arguments have the opposite sign of the result if (((x ^ r) & (y ^ r)) < 0) { throw new ArithmeticException("integer overflow"); } return r; }
[ "public", "static", "int", "addExact", "(", "int", "x", ",", "int", "y", ")", "{", "int", "r", "=", "x", "+", "y", ";", "// HD 2-12 Overflow iff both arguments have the opposite sign of the result", "if", "(", "(", "(", "x", "^", "r", ")", "&", "(", "y", ...
Returns the sum of its arguments, throwing an exception if the result overflows an {@code int}. @param x the first value @param y the second value @return the result @throws ArithmeticException if the result overflows an int @since 1.8
[ "Returns", "the", "sum", "of", "its", "arguments", "throwing", "an", "exception", "if", "the", "result", "overflows", "an", "{", "@code", "int", "}", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Math.java#L791-L798
alkacon/opencms-core
src-gwt/org/opencms/gwt/client/ui/CmsAreaSelectPanel.java
CmsAreaSelectPanel.getYForX
private int getYForX(int newX, int newY) { """ Calculates the matching Y (top/height) value in case of a fixed height/width ratio.<p> @param newX the cursor X offset to the selection area @param newY the cursor Y offset to the selection area @return the matching Y value """ int height = (int)Ma...
java
private int getYForX(int newX, int newY) { int height = (int)Math.floor((newX - m_firstX) * m_heightToWidth); int result = m_firstY + height; if (((m_firstY - newY) * (m_firstY - result)) < 0) { result = m_firstY - height; } return result; }
[ "private", "int", "getYForX", "(", "int", "newX", ",", "int", "newY", ")", "{", "int", "height", "=", "(", "int", ")", "Math", ".", "floor", "(", "(", "newX", "-", "m_firstX", ")", "*", "m_heightToWidth", ")", ";", "int", "result", "=", "m_firstY", ...
Calculates the matching Y (top/height) value in case of a fixed height/width ratio.<p> @param newX the cursor X offset to the selection area @param newY the cursor Y offset to the selection area @return the matching Y value
[ "Calculates", "the", "matching", "Y", "(", "top", "/", "height", ")", "value", "in", "case", "of", "a", "fixed", "height", "/", "width", "ratio", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/CmsAreaSelectPanel.java#L673-L681
UrielCh/ovh-java-sdk
ovh-java-sdk-hostingprivateDatabase/src/main/java/net/minidev/ovh/api/ApiOvhHostingprivateDatabase.java
ApiOvhHostingprivateDatabase.serviceName_database_databaseName_GET
public OvhDatabase serviceName_database_databaseName_GET(String serviceName, String databaseName) throws IOException { """ Get this object properties REST: GET /hosting/privateDatabase/{serviceName}/database/{databaseName} @param serviceName [required] The internal name of your private database @param databas...
java
public OvhDatabase serviceName_database_databaseName_GET(String serviceName, String databaseName) throws IOException { String qPath = "/hosting/privateDatabase/{serviceName}/database/{databaseName}"; StringBuilder sb = path(qPath, serviceName, databaseName); String resp = exec(qPath, "GET", sb.toString(), null); ...
[ "public", "OvhDatabase", "serviceName_database_databaseName_GET", "(", "String", "serviceName", ",", "String", "databaseName", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/hosting/privateDatabase/{serviceName}/database/{databaseName}\"", ";", "StringBuilder", ...
Get this object properties REST: GET /hosting/privateDatabase/{serviceName}/database/{databaseName} @param serviceName [required] The internal name of your private database @param databaseName [required] Database name
[ "Get", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingprivateDatabase/src/main/java/net/minidev/ovh/api/ApiOvhHostingprivateDatabase.java#L578-L583
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java
HtmlDocWriter.getHyperLink
public Content getHyperLink(SectionName sectionName, String where, Content label) { """ Get Html Hyper Link Content. @param sectionName The section name combined with where to which the link will be created. @param where The fragment combined with sectionName to ...
java
public Content getHyperLink(SectionName sectionName, String where, Content label) { return getHyperLink(getDocLink(sectionName, where), label, "", ""); }
[ "public", "Content", "getHyperLink", "(", "SectionName", "sectionName", ",", "String", "where", ",", "Content", "label", ")", "{", "return", "getHyperLink", "(", "getDocLink", "(", "sectionName", ",", "where", ")", ",", "label", ",", "\"\"", ",", "\"\"", ")"...
Get Html Hyper Link Content. @param sectionName The section name combined with where to which the link will be created. @param where The fragment combined with sectionName to which the link will be created. @param label Tag for the link. @return a content tree for the hyper link
[ "Get", "Html", "Hyper", "Link", "Content", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java#L121-L124
undertow-io/undertow
core/src/main/java/io/undertow/server/handlers/proxy/mod_cluster/NodePingUtil.java
NodePingUtil.internalPingNode
static void internalPingNode(Node node, PingCallback callback, NodeHealthChecker healthChecker, XnioIoThread ioThread, ByteBufferPool bufferPool, UndertowClient client, XnioSsl xnioSsl, OptionMap options) { """ Internally ping a node. This should probably use the connections from the nodes pool, if there are any a...
java
static void internalPingNode(Node node, PingCallback callback, NodeHealthChecker healthChecker, XnioIoThread ioThread, ByteBufferPool bufferPool, UndertowClient client, XnioSsl xnioSsl, OptionMap options) { final URI uri = node.getNodeConfig().getConnectionURI(); final long timeout = node.getNodeConfig...
[ "static", "void", "internalPingNode", "(", "Node", "node", ",", "PingCallback", "callback", ",", "NodeHealthChecker", "healthChecker", ",", "XnioIoThread", "ioThread", ",", "ByteBufferPool", "bufferPool", ",", "UndertowClient", "client", ",", "XnioSsl", "xnioSsl", ","...
Internally ping a node. This should probably use the connections from the nodes pool, if there are any available. @param node the node @param callback the ping callback @param ioThread the xnio i/o thread @param bufferPool the xnio buffer pool @param client the undertow client @param xnioS...
[ "Internally", "ping", "a", "node", ".", "This", "should", "probably", "use", "the", "connections", "from", "the", "nodes", "pool", "if", "there", "are", "any", "available", "." ]
train
https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/handlers/proxy/mod_cluster/NodePingUtil.java#L170-L179
xwiki/xwiki-rendering
xwiki-rendering-transformations/xwiki-rendering-transformation-macro/src/main/java/org/xwiki/rendering/internal/transformation/macro/MacroErrorManager.java
MacroErrorManager.generateError
public void generateError(MacroBlock macroToReplace, String message, Throwable throwable) { """ Generates Blocks to signify that the passed Macro Block has failed to execute. @param macroToReplace the block for the macro that failed to execute and that we'll replace with Block showing to the user that macro ha...
java
public void generateError(MacroBlock macroToReplace, String message, Throwable throwable) { List<Block> errorBlocks = this.errorBlockGenerator.generateErrorBlocks(message, throwable, macroToReplace.isInline()); macroToReplace.getParent().replaceChild(wrapInMacroMarker(macroToReplace, err...
[ "public", "void", "generateError", "(", "MacroBlock", "macroToReplace", ",", "String", "message", ",", "Throwable", "throwable", ")", "{", "List", "<", "Block", ">", "errorBlocks", "=", "this", ".", "errorBlockGenerator", ".", "generateErrorBlocks", "(", "message"...
Generates Blocks to signify that the passed Macro Block has failed to execute. @param macroToReplace the block for the macro that failed to execute and that we'll replace with Block showing to the user that macro has failed @param message the message to display to the user in place of the macro result @param throwable...
[ "Generates", "Blocks", "to", "signify", "that", "the", "passed", "Macro", "Block", "has", "failed", "to", "execute", "." ]
train
https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-transformations/xwiki-rendering-transformation-macro/src/main/java/org/xwiki/rendering/internal/transformation/macro/MacroErrorManager.java#L75-L80
lucee/Lucee
core/src/main/java/lucee/runtime/config/ConfigWebUtil.java
ConfigWebUtil.hasAccess
public static boolean hasAccess(Config config, int type) { """ has access checks if config object has access to given type @param config @param type @return has access """ boolean has = true; if (config instanceof ConfigWeb) { has = ((ConfigWeb) config).getSecurityManager().getAccess(type) != Secu...
java
public static boolean hasAccess(Config config, int type) { boolean has = true; if (config instanceof ConfigWeb) { has = ((ConfigWeb) config).getSecurityManager().getAccess(type) != SecurityManager.VALUE_NO; } return has; }
[ "public", "static", "boolean", "hasAccess", "(", "Config", "config", ",", "int", "type", ")", "{", "boolean", "has", "=", "true", ";", "if", "(", "config", "instanceof", "ConfigWeb", ")", "{", "has", "=", "(", "(", "ConfigWeb", ")", "config", ")", ".",...
has access checks if config object has access to given type @param config @param type @return has access
[ "has", "access", "checks", "if", "config", "object", "has", "access", "to", "given", "type" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/ConfigWebUtil.java#L427-L434
JOML-CI/JOML
src/org/joml/Matrix4f.java
Matrix4f.rotateTowards
public Matrix4f rotateTowards(float dirX, float dirY, float dirZ, float upX, float upY, float upZ, Matrix4f dest) { """ Apply a model transformation to this matrix for a right-handed coordinate system, that aligns the local <code>+Z</code> axis with <code>(dirX, dirY, dirZ)</code> and store the result in <code>d...
java
public Matrix4f rotateTowards(float dirX, float dirY, float dirZ, float upX, float upY, float upZ, Matrix4f dest) { // Normalize direction float invDirLength = 1.0f / (float) Math.sqrt(dirX * dirX + dirY * dirY + dirZ * dirZ); float ndirX = dirX * invDirLength; float ndirY = dirY * invDi...
[ "public", "Matrix4f", "rotateTowards", "(", "float", "dirX", ",", "float", "dirY", ",", "float", "dirZ", ",", "float", "upX", ",", "float", "upY", ",", "float", "upZ", ",", "Matrix4f", "dest", ")", "{", "// Normalize direction", "float", "invDirLength", "=",...
Apply a model transformation to this matrix for a right-handed coordinate system, that aligns the local <code>+Z</code> axis with <code>(dirX, dirY, dirZ)</code> and store the result in <code>dest</code>. <p> If <code>M</code> is <code>this</code> matrix and <code>L</code> the lookat matrix, then the new matrix will be...
[ "Apply", "a", "model", "transformation", "to", "this", "matrix", "for", "a", "right", "-", "handed", "coordinate", "system", "that", "aligns", "the", "local", "<code", ">", "+", "Z<", "/", "code", ">", "axis", "with", "<code", ">", "(", "dirX", "dirY", ...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L14231-L14286
phax/ph-css
ph-css/src/main/java/com/helger/css/utils/CSSRectHelper.java
CSSRectHelper.getAsRect
@Nullable public static CSSRect getAsRect (@Nullable final String sCSSValue) { """ Interpret the passed value as a CSS rectangle and convert it to a {@link CSSRect}. @param sCSSValue The CSS values to check. May be <code>null</code>. @return <code>null</code> if the passed String is not a CSS rectangle. ...
java
@Nullable public static CSSRect getAsRect (@Nullable final String sCSSValue) { final String [] aValues = getRectValues (sCSSValue); return aValues == null ? null : new CSSRect (aValues[0], aValues[1], aValues[2], aValues[3]); }
[ "@", "Nullable", "public", "static", "CSSRect", "getAsRect", "(", "@", "Nullable", "final", "String", "sCSSValue", ")", "{", "final", "String", "[", "]", "aValues", "=", "getRectValues", "(", "sCSSValue", ")", ";", "return", "aValues", "==", "null", "?", "...
Interpret the passed value as a CSS rectangle and convert it to a {@link CSSRect}. @param sCSSValue The CSS values to check. May be <code>null</code>. @return <code>null</code> if the passed String is not a CSS rectangle.
[ "Interpret", "the", "passed", "value", "as", "a", "CSS", "rectangle", "and", "convert", "it", "to", "a", "{", "@link", "CSSRect", "}", "." ]
train
https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/utils/CSSRectHelper.java#L129-L134
primefaces/primefaces
src/main/java/org/primefaces/util/ComponentUtils.java
ComponentUtils.createContentDisposition
public static String createContentDisposition(String value, String filename) { """ Creates an RFC 6266 Content-Dispostion header following all UTF-8 conventions. <p> @param value e.g. "attachment" @param filename the name of the file @return a valid Content-Disposition header in UTF-8 format """ tr...
java
public static String createContentDisposition(String value, String filename) { try { return String.format("%s;filename=\"%2$s\"; filename*=UTF-8''%2$s", value, encodeURI(filename)); } catch (UnsupportedEncodingException e) { throw new FacesException(e); } }
[ "public", "static", "String", "createContentDisposition", "(", "String", "value", ",", "String", "filename", ")", "{", "try", "{", "return", "String", ".", "format", "(", "\"%s;filename=\\\"%2$s\\\"; filename*=UTF-8''%2$s\"", ",", "value", ",", "encodeURI", "(", "fi...
Creates an RFC 6266 Content-Dispostion header following all UTF-8 conventions. <p> @param value e.g. "attachment" @param filename the name of the file @return a valid Content-Disposition header in UTF-8 format
[ "Creates", "an", "RFC", "6266", "Content", "-", "Dispostion", "header", "following", "all", "UTF", "-", "8", "conventions", ".", "<p", ">" ]
train
https://github.com/primefaces/primefaces/blob/b8cdd5ed395d09826e40e3302d6b14901d3ef4e7/src/main/java/org/primefaces/util/ComponentUtils.java#L510-L517
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/util/BrokerHelper.java
BrokerHelper.getKeyValues
public ValueContainer[] getKeyValues(ClassDescriptor cld, Identity oid) throws PersistenceBrokerException { """ Return primary key values of given Identity object. @param cld @param oid @return Object[] @throws PersistenceBrokerException """ return getKeyValues(cld, oid, true); }
java
public ValueContainer[] getKeyValues(ClassDescriptor cld, Identity oid) throws PersistenceBrokerException { return getKeyValues(cld, oid, true); }
[ "public", "ValueContainer", "[", "]", "getKeyValues", "(", "ClassDescriptor", "cld", ",", "Identity", "oid", ")", "throws", "PersistenceBrokerException", "{", "return", "getKeyValues", "(", "cld", ",", "oid", ",", "true", ")", ";", "}" ]
Return primary key values of given Identity object. @param cld @param oid @return Object[] @throws PersistenceBrokerException
[ "Return", "primary", "key", "values", "of", "given", "Identity", "object", "." ]
train
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/BrokerHelper.java#L190-L193
carewebframework/carewebframework-vista
org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/Request.java
Request.addParameter
public void addParameter(String name, String sub, Object data) { """ Adds a subscripted parameter to the request. @param name Parameter name. @param sub Subscript(s). @param data Parameter value. """ pack(name); pack(sub); pack(BrokerUtil.toString(data)); }
java
public void addParameter(String name, String sub, Object data) { pack(name); pack(sub); pack(BrokerUtil.toString(data)); }
[ "public", "void", "addParameter", "(", "String", "name", ",", "String", "sub", ",", "Object", "data", ")", "{", "pack", "(", "name", ")", ";", "pack", "(", "sub", ")", ";", "pack", "(", "BrokerUtil", ".", "toString", "(", "data", ")", ")", ";", "}"...
Adds a subscripted parameter to the request. @param name Parameter name. @param sub Subscript(s). @param data Parameter value.
[ "Adds", "a", "subscripted", "parameter", "to", "the", "request", "." ]
train
https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/Request.java#L154-L158
CloudBees-community/syslog-java-client
src/main/java/com/cloudbees/syslog/integration/jul/util/LogManagerHelper.java
LogManagerHelper.getLevelProperty
@Nullable public static Level getLevelProperty(@Nonnull LogManager manager, @Nonnull String name, @Nullable Level defaultValue) { """ Visible version of {@link java.util.logging.LogManager#getLevelProperty(String, java.util.logging.Level)}. If the property is not defined or cannot be parsed we return the gi...
java
@Nullable public static Level getLevelProperty(@Nonnull LogManager manager, @Nonnull String name, @Nullable Level defaultValue) { if (name == null) { return defaultValue; } String val = manager.getProperty(name); if (val == null) { return defaultValue; ...
[ "@", "Nullable", "public", "static", "Level", "getLevelProperty", "(", "@", "Nonnull", "LogManager", "manager", ",", "@", "Nonnull", "String", "name", ",", "@", "Nullable", "Level", "defaultValue", ")", "{", "if", "(", "name", "==", "null", ")", "{", "retu...
Visible version of {@link java.util.logging.LogManager#getLevelProperty(String, java.util.logging.Level)}. If the property is not defined or cannot be parsed we return the given default value.
[ "Visible", "version", "of", "{", "@link", "java", ".", "util", ".", "logging", ".", "LogManager#getLevelProperty", "(", "String", "java", ".", "util", ".", "logging", ".", "Level", ")", "}", "." ]
train
https://github.com/CloudBees-community/syslog-java-client/blob/41e01206e4ce17c6d225ffb443bf19792a3f3c3a/src/main/java/com/cloudbees/syslog/integration/jul/util/LogManagerHelper.java#L43-L54
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/bcel/BCELUtil.java
BCELUtil.getMethodDescriptor
public static MethodDescriptor getMethodDescriptor(JavaClass jclass, Method method) { """ Construct a MethodDescriptor from JavaClass and method. @param jclass a JavaClass @param method a Method belonging to the JavaClass @return a MethodDescriptor identifying the method """ return DescriptorFac...
java
public static MethodDescriptor getMethodDescriptor(JavaClass jclass, Method method) { return DescriptorFactory.instance().getMethodDescriptor(jclass.getClassName().replace('.', '/'), method.getName(), method.getSignature(), method.isStatic()); }
[ "public", "static", "MethodDescriptor", "getMethodDescriptor", "(", "JavaClass", "jclass", ",", "Method", "method", ")", "{", "return", "DescriptorFactory", ".", "instance", "(", ")", ".", "getMethodDescriptor", "(", "jclass", ".", "getClassName", "(", ")", ".", ...
Construct a MethodDescriptor from JavaClass and method. @param jclass a JavaClass @param method a Method belonging to the JavaClass @return a MethodDescriptor identifying the method
[ "Construct", "a", "MethodDescriptor", "from", "JavaClass", "and", "method", "." ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/bcel/BCELUtil.java#L52-L55
mapsforge/mapsforge
mapsforge-map/src/main/java/org/mapsforge/map/layer/labels/TileBasedLabelStore.java
TileBasedLabelStore.storeMapItems
public synchronized void storeMapItems(Tile tile, List<MapElementContainer> mapItems) { """ Stores a list of MapElements against a tile. @param tile tile on which the mapItems reside. @param mapItems the map elements. """ this.put(tile, LayerUtil.collisionFreeOrdered(mapItems)); this.ve...
java
public synchronized void storeMapItems(Tile tile, List<MapElementContainer> mapItems) { this.put(tile, LayerUtil.collisionFreeOrdered(mapItems)); this.version += 1; }
[ "public", "synchronized", "void", "storeMapItems", "(", "Tile", "tile", ",", "List", "<", "MapElementContainer", ">", "mapItems", ")", "{", "this", ".", "put", "(", "tile", ",", "LayerUtil", ".", "collisionFreeOrdered", "(", "mapItems", ")", ")", ";", "this"...
Stores a list of MapElements against a tile. @param tile tile on which the mapItems reside. @param mapItems the map elements.
[ "Stores", "a", "list", "of", "MapElements", "against", "a", "tile", "." ]
train
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/layer/labels/TileBasedLabelStore.java#L53-L56
OpenCompare/OpenCompare
org.opencompare/pcmdata-importers/src/main/java/data_off/OFFDumpRetriever.java
OFFDumpRetriever.unGzip
private File unGzip(final File inputFile, final File outputDir) throws FileNotFoundException, IOException { """ Ungzip an input file into an output file. <p> The output file is created in the output folder, having the same name as the input file, minus the '.gz' extension. @param inputFile the input .gz ...
java
private File unGzip(final File inputFile, final File outputDir) throws FileNotFoundException, IOException { _log.info(String.format("Ungzipping %s to dir %s.", inputFile.getAbsolutePath(), outputDir.getAbsolutePath())); //final File outputFile = new File(outputDir, inputFile.getName().substring(0, inputFile...
[ "private", "File", "unGzip", "(", "final", "File", "inputFile", ",", "final", "File", "outputDir", ")", "throws", "FileNotFoundException", ",", "IOException", "{", "_log", ".", "info", "(", "String", ".", "format", "(", "\"Ungzipping %s to dir %s.\"", ",", "inpu...
Ungzip an input file into an output file. <p> The output file is created in the output folder, having the same name as the input file, minus the '.gz' extension. @param inputFile the input .gz file @param outputDir the output directory file. @throws IOException @throws FileNotFoundException @return The {@Fil...
[ "Ungzip", "an", "input", "file", "into", "an", "output", "file", ".", "<p", ">", "The", "output", "file", "is", "created", "in", "the", "output", "folder", "having", "the", "same", "name", "as", "the", "input", "file", "minus", "the", ".", "gz", "exten...
train
https://github.com/OpenCompare/OpenCompare/blob/6cd776466b375cb8ecca08fcd94e573d65e20b14/org.opencompare/pcmdata-importers/src/main/java/data_off/OFFDumpRetriever.java#L100-L115
astrapi69/jaulp-wicket
jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/util/WicketImageExtensions.java
WicketImageExtensions.getImage
public static Image getImage(final String wicketId, final String contentType, final Byte[] data) { """ Gets the image. @param wicketId the id from the image for the html template. @param contentType the content type @param data the data @return the image """ final byte[] byteArrayData = ArrayUtils.t...
java
public static Image getImage(final String wicketId, final String contentType, final Byte[] data) { final byte[] byteArrayData = ArrayUtils.toPrimitive(data); return getImage(wicketId, contentType, byteArrayData); }
[ "public", "static", "Image", "getImage", "(", "final", "String", "wicketId", ",", "final", "String", "contentType", ",", "final", "Byte", "[", "]", "data", ")", "{", "final", "byte", "[", "]", "byteArrayData", "=", "ArrayUtils", ".", "toPrimitive", "(", "d...
Gets the image. @param wicketId the id from the image for the html template. @param contentType the content type @param data the data @return the image
[ "Gets", "the", "image", "." ]
train
https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/util/WicketImageExtensions.java#L58-L62
alkacon/opencms-core
src/org/opencms/util/CmsStringUtil.java
CmsStringUtil.getCommonPrefixPath
public static String getCommonPrefixPath(String first, String second) { """ Returns the common parent path of two paths.<p> <b>Directly exposed for JSP EL</b>, not through {@link org.opencms.jsp.util.CmsJspElFunctions}.<p> @param first the first path @param second the second path @return the common prefi...
java
public static String getCommonPrefixPath(String first, String second) { List<String> firstComponents = getPathComponents(first); List<String> secondComponents = getPathComponents(second); int minSize = Math.min(firstComponents.size(), secondComponents.size()); StringBuffer resultBuffer ...
[ "public", "static", "String", "getCommonPrefixPath", "(", "String", "first", ",", "String", "second", ")", "{", "List", "<", "String", ">", "firstComponents", "=", "getPathComponents", "(", "first", ")", ";", "List", "<", "String", ">", "secondComponents", "="...
Returns the common parent path of two paths.<p> <b>Directly exposed for JSP EL</b>, not through {@link org.opencms.jsp.util.CmsJspElFunctions}.<p> @param first the first path @param second the second path @return the common prefix path
[ "Returns", "the", "common", "parent", "path", "of", "two", "paths", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsStringUtil.java#L745-L764
citiususc/hipster
hipster-core/src/main/java/es/usc/citius/hipster/model/function/impl/ADStarNodeExpander.java
ADStarNodeExpander.updateConsistent
private boolean updateConsistent(N node, N parent, Transition<A, S> transition) { """ Updates a node in consistent state (V > G) updating the path and the cost if the parent node and the transition improves the current cost of the node. @param node {@link es.usc.citius.hipster.algorithm.ADStarForward} node to ...
java
private boolean updateConsistent(N node, N parent, Transition<A, S> transition) { // parent.getG().add(this.costFunction.evaluate(transition)); C accumulatedCost = add.apply(parent.getG(), costFunction.evaluate(transition)); if (node.getG().compareTo(accumulatedCost) > 0) { node.setP...
[ "private", "boolean", "updateConsistent", "(", "N", "node", ",", "N", "parent", ",", "Transition", "<", "A", ",", "S", ">", "transition", ")", "{", "// parent.getG().add(this.costFunction.evaluate(transition));", "C", "accumulatedCost", "=", "add", ".", "apply", "...
Updates a node in consistent state (V > G) updating the path and the cost if the parent node and the transition improves the current cost of the node. @param node {@link es.usc.citius.hipster.algorithm.ADStarForward} node to update, in consistent state @param parent previous {@link es.usc.citius.hipster.algorithm.ADSt...
[ "Updates", "a", "node", "in", "consistent", "state", "(", "V", ">", "G", ")", "updating", "the", "path", "and", "the", "cost", "if", "the", "parent", "node", "and", "the", "transition", "improves", "the", "current", "cost", "of", "the", "node", "." ]
train
https://github.com/citiususc/hipster/blob/9ab1236abb833a27641ae73ba9ca890d5c17598e/hipster-core/src/main/java/es/usc/citius/hipster/model/function/impl/ADStarNodeExpander.java#L165-L180
Azure/azure-sdk-for-java
batch/data-plane/src/main/java/com/microsoft/azure/batch/PoolOperations.java
PoolOperations.deletePool
public void deletePool(String poolId, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException { """ Deletes the specified pool. @param poolId The ID of the pool to delete. @param additionalBehaviors A collection of {@link BatchClientBehavior} instances that are ...
java
public void deletePool(String poolId, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException { PoolDeleteOptions options = new PoolDeleteOptions(); BehaviorManager bhMgr = new BehaviorManager(this.customBehaviors(), additionalBehaviors); bhMgr.appl...
[ "public", "void", "deletePool", "(", "String", "poolId", ",", "Iterable", "<", "BatchClientBehavior", ">", "additionalBehaviors", ")", "throws", "BatchErrorException", ",", "IOException", "{", "PoolDeleteOptions", "options", "=", "new", "PoolDeleteOptions", "(", ")", ...
Deletes the specified pool. @param poolId The ID of the pool to delete. @param additionalBehaviors A collection of {@link BatchClientBehavior} instances that are applied to the Batch service request. @throws BatchErrorException Exception thrown when an error response is received from the Batch service. @throws IOExcep...
[ "Deletes", "the", "specified", "pool", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/PoolOperations.java#L258-L265
apache/incubator-gobblin
gobblin-runtime/src/main/java/org/apache/gobblin/service/monitoring/FlowStatusGenerator.java
FlowStatusGenerator.isFlowRunning
public boolean isFlowRunning(String flowName, String flowGroup) { """ Return true if another instance of a flow is running. A flow is determined to be in the RUNNING state, if any of the jobs in the flow are in the RUNNING state. @param flowName @param flowGroup @return true, if any jobs of the flow are RUNNIN...
java
public boolean isFlowRunning(String flowName, String flowGroup) { List<FlowStatus> flowStatusList = getLatestFlowStatus(flowName, flowGroup, 1); if (flowStatusList == null || flowStatusList.isEmpty()) { return false; } else { FlowStatus flowStatus = flowStatusList.get(0); Iterator<JobStatu...
[ "public", "boolean", "isFlowRunning", "(", "String", "flowName", ",", "String", "flowGroup", ")", "{", "List", "<", "FlowStatus", ">", "flowStatusList", "=", "getLatestFlowStatus", "(", "flowName", ",", "flowGroup", ",", "1", ")", ";", "if", "(", "flowStatusLi...
Return true if another instance of a flow is running. A flow is determined to be in the RUNNING state, if any of the jobs in the flow are in the RUNNING state. @param flowName @param flowGroup @return true, if any jobs of the flow are RUNNING.
[ "Return", "true", "if", "another", "instance", "of", "a", "flow", "is", "running", ".", "A", "flow", "is", "determined", "to", "be", "in", "the", "RUNNING", "state", "if", "any", "of", "the", "jobs", "in", "the", "flow", "are", "in", "the", "RUNNING", ...
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/service/monitoring/FlowStatusGenerator.java#L87-L103
dlemmermann/CalendarFX
CalendarFXView/src/main/java/com/calendarfx/view/DateControl.java
DateControl.setDateDetailsCallback
public final void setDateDetailsCallback(Callback<DateDetailsParameter, Boolean> callback) { """ Sets the value of {@link #dateDetailsCallbackProperty()}. @param callback the date details callback """ requireNonNull(callback); dateDetailsCallbackProperty().set(callback); }
java
public final void setDateDetailsCallback(Callback<DateDetailsParameter, Boolean> callback) { requireNonNull(callback); dateDetailsCallbackProperty().set(callback); }
[ "public", "final", "void", "setDateDetailsCallback", "(", "Callback", "<", "DateDetailsParameter", ",", "Boolean", ">", "callback", ")", "{", "requireNonNull", "(", "callback", ")", ";", "dateDetailsCallbackProperty", "(", ")", ".", "set", "(", "callback", ")", ...
Sets the value of {@link #dateDetailsCallbackProperty()}. @param callback the date details callback
[ "Sets", "the", "value", "of", "{", "@link", "#dateDetailsCallbackProperty", "()", "}", "." ]
train
https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/view/DateControl.java#L1597-L1600
mgm-tp/jfunk
jfunk-core/src/main/java/com/mgmtp/jfunk/core/config/ModulesLoader.java
ModulesLoader.loadModulesFromProperties
public static Module loadModulesFromProperties(final Module jFunkModule, final String propertiesFile) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IOException { """ Loads Guice modules whose class names are specified as properties. All properties starting with "module." are co...
java
public static Module loadModulesFromProperties(final Module jFunkModule, final String propertiesFile) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IOException { final List<Module> modules = Lists.newArrayList(); LOG.debug("Using jfunk.props.file=" + propertiesFile); Propertie...
[ "public", "static", "Module", "loadModulesFromProperties", "(", "final", "Module", "jFunkModule", ",", "final", "String", "propertiesFile", ")", "throws", "ClassNotFoundException", ",", "InstantiationException", ",", "IllegalAccessException", ",", "IOException", "{", "fin...
Loads Guice modules whose class names are specified as properties. All properties starting with "module." are considered to have a fully qualified class name representing a Guice module. The modules are combined and override thespecified jFunkModule. @param propertiesFile The properties file @return the combined modul...
[ "Loads", "Guice", "modules", "whose", "class", "names", "are", "specified", "as", "properties", ".", "All", "properties", "starting", "with", "module", ".", "are", "considered", "to", "have", "a", "fully", "qualified", "class", "name", "representing", "a", "Gu...
train
https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-core/src/main/java/com/mgmtp/jfunk/core/config/ModulesLoader.java#L60-L78
liyiorg/weixin-popular
src/main/java/weixin/popular/api/BizwifiAPI.java
BizwifiAPI.shopList
public static ShopListResult shopList(String accessToken, ShopList shopList) { """ Wi-Fi门店管理-获取Wi-Fi门店列表 通过此接口获取WiFi的门店列表,该列表包括公众平台的门店信息、以及添加设备后的WiFi相关信息。 注:微信连Wi-Fi下的所有接口中的shop_id,必需先通过此接口获取。 @param accessToken accessToken @param shopList shopList @return ShopListResult """ return shopList(...
java
public static ShopListResult shopList(String accessToken, ShopList shopList) { return shopList(accessToken, JsonUtil.toJSONString(shopList)); }
[ "public", "static", "ShopListResult", "shopList", "(", "String", "accessToken", ",", "ShopList", "shopList", ")", "{", "return", "shopList", "(", "accessToken", ",", "JsonUtil", ".", "toJSONString", "(", "shopList", ")", ")", ";", "}" ]
Wi-Fi门店管理-获取Wi-Fi门店列表 通过此接口获取WiFi的门店列表,该列表包括公众平台的门店信息、以及添加设备后的WiFi相关信息。 注:微信连Wi-Fi下的所有接口中的shop_id,必需先通过此接口获取。 @param accessToken accessToken @param shopList shopList @return ShopListResult
[ "Wi", "-", "Fi门店管理", "-", "获取Wi", "-", "Fi门店列表", "通过此接口获取WiFi的门店列表,该列表包括公众平台的门店信息、以及添加设备后的WiFi相关信息。", "注:微信连Wi", "-", "Fi下的所有接口中的shop_id,必需先通过此接口获取。" ]
train
https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/BizwifiAPI.java#L221-L223
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/parsers/SoapParser.java
SoapParser.parseSoap12Fault
private void parseSoap12Fault(Document soapMessage, PrintWriter logger) throws Exception { """ A method to parse a SOAP 1.2 fault message. @param soapMessage the SOAP 1.2 fault message to parse @param logger the PrintWriter to log all results to @return void @author Simone Gianfranceschi ...
java
private void parseSoap12Fault(Document soapMessage, PrintWriter logger) throws Exception { Element envelope = soapMessage.getDocumentElement(); Element code = DomUtils.getElementByTagNameNS(envelope, SOAP_12_NAMESPACE, "Code"); String value = DomUtils.getElementByTagN...
[ "private", "void", "parseSoap12Fault", "(", "Document", "soapMessage", ",", "PrintWriter", "logger", ")", "throws", "Exception", "{", "Element", "envelope", "=", "soapMessage", ".", "getDocumentElement", "(", ")", ";", "Element", "code", "=", "DomUtils", ".", "g...
A method to parse a SOAP 1.2 fault message. @param soapMessage the SOAP 1.2 fault message to parse @param logger the PrintWriter to log all results to @return void @author Simone Gianfranceschi
[ "A", "method", "to", "parse", "a", "SOAP", "1", ".", "2", "fault", "message", "." ]
train
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/parsers/SoapParser.java#L318-L343
alkacon/opencms-core
src/org/opencms/workplace/CmsWorkplace.java
CmsWorkplace.getWorkplaceExplorerLink
public static String getWorkplaceExplorerLink(final CmsJspActionElement jsp, final String explorerRootPath) { """ Creates a link for the OpenCms workplace that will reload the whole workplace, switch to the explorer view, the site of the given explorerRootPath and show the folder given in the explorerRootPath. <...
java
public static String getWorkplaceExplorerLink(final CmsJspActionElement jsp, final String explorerRootPath) { return getWorkplaceExplorerLink(jsp.getCmsObject(), explorerRootPath); }
[ "public", "static", "String", "getWorkplaceExplorerLink", "(", "final", "CmsJspActionElement", "jsp", ",", "final", "String", "explorerRootPath", ")", "{", "return", "getWorkplaceExplorerLink", "(", "jsp", ".", "getCmsObject", "(", ")", ",", "explorerRootPath", ")", ...
Creates a link for the OpenCms workplace that will reload the whole workplace, switch to the explorer view, the site of the given explorerRootPath and show the folder given in the explorerRootPath. <p> @param jsp needed for link functionality. @param explorerRootPath a root relative folder link (has to end with '/')....
[ "Creates", "a", "link", "for", "the", "OpenCms", "workplace", "that", "will", "reload", "the", "whole", "workplace", "switch", "to", "the", "explorer", "view", "the", "site", "of", "the", "given", "explorerRootPath", "and", "show", "the", "folder", "given", ...
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsWorkplace.java#L753-L757
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/common/JFAPCommunicator.java
JFAPCommunicator.invalidateConnection
protected void invalidateConnection(boolean notifyPeer, Throwable throwable, String debugReason) { """ Utility method to invalidate Connection. Parameters passed to ConnectionInterface.invalidate @param notifyPeer @param throwable @param debugReason """ if (TraceComponent.isAnyTracingEnabled() && tc...
java
protected void invalidateConnection(boolean notifyPeer, Throwable throwable, String debugReason) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "invalidateConnection", new Object[]{new Boolean(notifyPeer), ...
[ "protected", "void", "invalidateConnection", "(", "boolean", "notifyPeer", ",", "Throwable", "throwable", ",", "String", "debugReason", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")",...
Utility method to invalidate Connection. Parameters passed to ConnectionInterface.invalidate @param notifyPeer @param throwable @param debugReason
[ "Utility", "method", "to", "invalidate", "Connection", ".", "Parameters", "passed", "to", "ConnectionInterface", ".", "invalidate" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/common/JFAPCommunicator.java#L1430-L1444
brettwooldridge/HikariCP
src/main/java/com/zaxxer/hikari/pool/HikariPool.java
HikariPool.softEvictConnection
private boolean softEvictConnection(final PoolEntry poolEntry, final String reason, final boolean owner) { """ "Soft" evict a Connection (/PoolEntry) from the pool. If this method is being called by the user directly through {@link com.zaxxer.hikari.HikariDataSource#evictConnection(Connection)} then {@code owner...
java
private boolean softEvictConnection(final PoolEntry poolEntry, final String reason, final boolean owner) { poolEntry.markEvicted(); if (owner || connectionBag.reserve(poolEntry)) { closeConnection(poolEntry, reason); return true; } return false; }
[ "private", "boolean", "softEvictConnection", "(", "final", "PoolEntry", "poolEntry", ",", "final", "String", "reason", ",", "final", "boolean", "owner", ")", "{", "poolEntry", ".", "markEvicted", "(", ")", ";", "if", "(", "owner", "||", "connectionBag", ".", ...
"Soft" evict a Connection (/PoolEntry) from the pool. If this method is being called by the user directly through {@link com.zaxxer.hikari.HikariDataSource#evictConnection(Connection)} then {@code owner} is {@code true}. If the caller is the owner, or if the Connection is idle (i.e. can be "reserved" in the {@link Co...
[ "Soft", "evict", "a", "Connection", "(", "/", "PoolEntry", ")", "from", "the", "pool", ".", "If", "this", "method", "is", "being", "called", "by", "the", "user", "directly", "through", "{", "@link", "com", ".", "zaxxer", ".", "hikari", ".", "HikariDataSo...
train
https://github.com/brettwooldridge/HikariCP/blob/c509ec1a3f1e19769ee69323972f339cf098ff4b/src/main/java/com/zaxxer/hikari/pool/HikariPool.java#L613-L622
wisdom-framework/wisdom
core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/WebJarPackager.java
WebJarPackager.fileCreated
@Override public boolean fileCreated(File file) throws WatchingException { """ Notifies the watcher that a new file is created. @param file is the file. @return {@literal false} if the pipeline processing must be interrupted for this event. Most watchers should return {@literal true} to let other watchers...
java
@Override public boolean fileCreated(File file) throws WatchingException { try { File output = process(); if (deployWebJarToWisdom) { // Copy the webjar to the right location copyToDestination(output); } } catch (Exception e) { ...
[ "@", "Override", "public", "boolean", "fileCreated", "(", "File", "file", ")", "throws", "WatchingException", "{", "try", "{", "File", "output", "=", "process", "(", ")", ";", "if", "(", "deployWebJarToWisdom", ")", "{", "// Copy the webjar to the right location",...
Notifies the watcher that a new file is created. @param file is the file. @return {@literal false} if the pipeline processing must be interrupted for this event. Most watchers should return {@literal true} to let other watchers be notified. @throws org.wisdom.maven.WatchingException if the watcher failed to process th...
[ "Notifies", "the", "watcher", "that", "a", "new", "file", "is", "created", "." ]
train
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/WebJarPackager.java#L205-L217
Javacord/Javacord
javacord-api/src/main/java/org/javacord/api/entity/message/embed/EmbedBuilder.java
EmbedBuilder.updateFields
public EmbedBuilder updateFields(Predicate<EmbedField> predicate, Consumer<EditableEmbedField> updater) { """ Updates all fields of the embed that satisfy the given predicate using the given updater. @param predicate The predicate that fields have to satisfy to get updated. @param updater The updater for the f...
java
public EmbedBuilder updateFields(Predicate<EmbedField> predicate, Consumer<EditableEmbedField> updater) { delegate.updateFields(predicate, updater); return this; }
[ "public", "EmbedBuilder", "updateFields", "(", "Predicate", "<", "EmbedField", ">", "predicate", ",", "Consumer", "<", "EditableEmbedField", ">", "updater", ")", "{", "delegate", ".", "updateFields", "(", "predicate", ",", "updater", ")", ";", "return", "this", ...
Updates all fields of the embed that satisfy the given predicate using the given updater. @param predicate The predicate that fields have to satisfy to get updated. @param updater The updater for the fields; the {@code EditableEmbedField} is only valid during the run of the updater; any try to save it in a variable an...
[ "Updates", "all", "fields", "of", "the", "embed", "that", "satisfy", "the", "given", "predicate", "using", "the", "given", "updater", "." ]
train
https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/message/embed/EmbedBuilder.java#L638-L641
gmessner/gitlab4j-api
src/main/java/org/gitlab4j/api/GroupApi.java
GroupApi.addLdapGroupLink
public void addLdapGroupLink(Object groupIdOrPath, String cn, Integer groupAccess, String provider) throws GitLabApiException { """ Adds an LDAP group link. <pre><code>GitLab Endpoint: POST /groups/:id/ldap_group_links</code></pre> @param groupIdOrPath the group ID, path of the group, or a Group instance hol...
java
public void addLdapGroupLink(Object groupIdOrPath, String cn, Integer groupAccess, String provider) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm() .withParam("cn", cn, true) .withParam("group_access", groupAccess, true) .withParam("provi...
[ "public", "void", "addLdapGroupLink", "(", "Object", "groupIdOrPath", ",", "String", "cn", ",", "Integer", "groupAccess", ",", "String", "provider", ")", "throws", "GitLabApiException", "{", "GitLabApiForm", "formData", "=", "new", "GitLabApiForm", "(", ")", ".", ...
Adds an LDAP group link. <pre><code>GitLab Endpoint: POST /groups/:id/ldap_group_links</code></pre> @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path @param cn the CN of a LDAP group @param groupAccess the minimum access level for members of the LDAP group @param p...
[ "Adds", "an", "LDAP", "group", "link", "." ]
train
https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GroupApi.java#L944-L950
sagiegurari/fax4j
src/main/java/org/fax4j/spi/http/HTTPFaxClientSpi.java
HTTPFaxClientSpi.submitHTTPRequestImpl
protected HTTPResponse submitHTTPRequestImpl(HTTPRequest httpRequest,HTTPMethod httpMethod) { """ Submits the HTTP request and returns the HTTP response. @param httpRequest The HTTP request to send @param httpMethod The HTTP method to use @return The HTTP response """ return this.httpClient...
java
protected HTTPResponse submitHTTPRequestImpl(HTTPRequest httpRequest,HTTPMethod httpMethod) { return this.httpClient.submitHTTPRequest(httpRequest,this.httpClientConfiguration,httpMethod); }
[ "protected", "HTTPResponse", "submitHTTPRequestImpl", "(", "HTTPRequest", "httpRequest", ",", "HTTPMethod", "httpMethod", ")", "{", "return", "this", ".", "httpClient", ".", "submitHTTPRequest", "(", "httpRequest", ",", "this", ".", "httpClientConfiguration", ",", "ht...
Submits the HTTP request and returns the HTTP response. @param httpRequest The HTTP request to send @param httpMethod The HTTP method to use @return The HTTP response
[ "Submits", "the", "HTTP", "request", "and", "returns", "the", "HTTP", "response", "." ]
train
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/http/HTTPFaxClientSpi.java#L626-L629
lukin0110/poeditor-java
src/main/java/be/lukin/poeditor/POEditorClient.java
POEditorClient.addAdministrator
public boolean addAdministrator(String projectId, String name, String email) { """ Create a new admin for a project @param projectId id of the project @param name name of the admin @param email email of the admin @return boolean if the administrator has been created """ ResponseWrapper wrapper = ...
java
public boolean addAdministrator(String projectId, String name, String email){ ResponseWrapper wrapper = service.addProjectMember(Action.ADD_CONTRIBUTOR, apiKey, projectId, name, email, null, 1); return "200".equals(wrapper.response.code); }
[ "public", "boolean", "addAdministrator", "(", "String", "projectId", ",", "String", "name", ",", "String", "email", ")", "{", "ResponseWrapper", "wrapper", "=", "service", ".", "addProjectMember", "(", "Action", ".", "ADD_CONTRIBUTOR", ",", "apiKey", ",", "proje...
Create a new admin for a project @param projectId id of the project @param name name of the admin @param email email of the admin @return boolean if the administrator has been created
[ "Create", "a", "new", "admin", "for", "a", "project" ]
train
https://github.com/lukin0110/poeditor-java/blob/42a2cd3136da1276b29a57a483c94050cc7d1d01/src/main/java/be/lukin/poeditor/POEditorClient.java#L183-L186
telly/groundy
library/src/main/java/com/telly/groundy/Groundy.java
Groundy.arg
public Groundy arg(String key, CharSequence value) { """ Inserts a CharSequence value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null. @param key a String, or null @param value a CharSequence, or null """ mArgs.putCharSequence(key, valu...
java
public Groundy arg(String key, CharSequence value) { mArgs.putCharSequence(key, value); return this; }
[ "public", "Groundy", "arg", "(", "String", "key", ",", "CharSequence", "value", ")", "{", "mArgs", ".", "putCharSequence", "(", "key", ",", "value", ")", ";", "return", "this", ";", "}" ]
Inserts a CharSequence value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null. @param key a String, or null @param value a CharSequence, or null
[ "Inserts", "a", "CharSequence", "value", "into", "the", "mapping", "of", "this", "Bundle", "replacing", "any", "existing", "value", "for", "the", "given", "key", ".", "Either", "key", "or", "value", "may", "be", "null", "." ]
train
https://github.com/telly/groundy/blob/e90baf9901a8be20b348bd1575d5ad782560cec8/library/src/main/java/com/telly/groundy/Groundy.java#L524-L527
apache/incubator-druid
extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java
ApproximateHistogram.shiftLeft
protected void shiftLeft(int start, int end) { """ Shifts the given range of histogram bins one slot to the left @param start index of the leftmost empty bin to shift into @param end index of the last bin to shift left """ for (int i = start; i < end; ++i) { positions[i] = positions[i + 1]; ...
java
protected void shiftLeft(int start, int end) { for (int i = start; i < end; ++i) { positions[i] = positions[i + 1]; bins[i] = bins[i + 1]; } }
[ "protected", "void", "shiftLeft", "(", "int", "start", ",", "int", "end", ")", "{", "for", "(", "int", "i", "=", "start", ";", "i", "<", "end", ";", "++", "i", ")", "{", "positions", "[", "i", "]", "=", "positions", "[", "i", "+", "1", "]", "...
Shifts the given range of histogram bins one slot to the left @param start index of the leftmost empty bin to shift into @param end index of the last bin to shift left
[ "Shifts", "the", "given", "range", "of", "histogram", "bins", "one", "slot", "to", "the", "left" ]
train
https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java#L465-L471
netscaler/sdx_nitro
src/main/java/com/citrix/sdx/nitro/resource/config/br/br_vm_template.java
br_vm_template.get_nitro_bulk_response
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { """ <pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre> """ br_vm_template_responses result = (br_vm_template_responses) service.ge...
java
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { br_vm_template_responses result = (br_vm_template_responses) service.get_payload_formatter().string_to_resource(br_vm_template_responses.class, response); if(result.errorcode != 0) { if (result.er...
[ "protected", "base_resource", "[", "]", "get_nitro_bulk_response", "(", "nitro_service", "service", ",", "String", "response", ")", "throws", "Exception", "{", "br_vm_template_responses", "result", "=", "(", "br_vm_template_responses", ")", "service", ".", "get_payload_...
<pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre>
[ "<pre", ">", "Converts", "API", "response", "of", "bulk", "operation", "into", "object", "and", "returns", "the", "object", "array", "in", "case", "of", "get", "request", ".", "<", "/", "pre", ">" ]
train
https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/br/br_vm_template.java#L173-L190
looly/hutool
hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java
CollUtil.newHashSet
public static <T> HashSet<T> newHashSet(boolean isSorted, Iterator<T> iter) { """ 新建一个HashSet @param <T> 集合元素类型 @param isSorted 是否有序,有序返回 {@link LinkedHashSet},否则返回{@link HashSet} @param iter {@link Iterator} @return HashSet对象 @since 3.0.8 """ if (null == iter) { return newHashSet(isSorted, (T[])...
java
public static <T> HashSet<T> newHashSet(boolean isSorted, Iterator<T> iter) { if (null == iter) { return newHashSet(isSorted, (T[]) null); } final HashSet<T> set = isSorted ? new LinkedHashSet<T>() : new HashSet<T>(); while (iter.hasNext()) { set.add(iter.next()); } return set; }
[ "public", "static", "<", "T", ">", "HashSet", "<", "T", ">", "newHashSet", "(", "boolean", "isSorted", ",", "Iterator", "<", "T", ">", "iter", ")", "{", "if", "(", "null", "==", "iter", ")", "{", "return", "newHashSet", "(", "isSorted", ",", "(", "...
新建一个HashSet @param <T> 集合元素类型 @param isSorted 是否有序,有序返回 {@link LinkedHashSet},否则返回{@link HashSet} @param iter {@link Iterator} @return HashSet对象 @since 3.0.8
[ "新建一个HashSet" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L472-L481
greenmail-mail-test/greenmail
greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java
CommandParser.consumeChar
protected void consumeChar(ImapRequestLineReader request, char expected) throws ProtocolException { """ Consumes the next character in the request, checking that it matches the expected one. This method should be used when the """ char consumed = request.consume(); if (consumed != ...
java
protected void consumeChar(ImapRequestLineReader request, char expected) throws ProtocolException { char consumed = request.consume(); if (consumed != expected) { throw new ProtocolException("Expected:'" + expected + "' found:'" + consumed + '\''); } }
[ "protected", "void", "consumeChar", "(", "ImapRequestLineReader", "request", ",", "char", "expected", ")", "throws", "ProtocolException", "{", "char", "consumed", "=", "request", ".", "consume", "(", ")", ";", "if", "(", "consumed", "!=", "expected", ")", "{",...
Consumes the next character in the request, checking that it matches the expected one. This method should be used when the
[ "Consumes", "the", "next", "character", "in", "the", "request", "checking", "that", "it", "matches", "the", "expected", "one", ".", "This", "method", "should", "be", "used", "when", "the" ]
train
https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java#L237-L243
apache/groovy
src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java
GenericsUtils.findParameterizedTypeFromCache
public static ClassNode findParameterizedTypeFromCache(final ClassNode genericsClass, final ClassNode actualType, boolean tryToFindExactType) { """ Try to get the parameterized type from the cache. If no cached item found, cache and return the result of {@link #findParameterizedType(ClassNode, ClassNode, boolean)...
java
public static ClassNode findParameterizedTypeFromCache(final ClassNode genericsClass, final ClassNode actualType, boolean tryToFindExactType) { if (!PARAMETERIZED_TYPE_CACHE_ENABLED) { return findParameterizedType(genericsClass, actualType, tryToFindExactType); } SoftReference<Class...
[ "public", "static", "ClassNode", "findParameterizedTypeFromCache", "(", "final", "ClassNode", "genericsClass", ",", "final", "ClassNode", "actualType", ",", "boolean", "tryToFindExactType", ")", "{", "if", "(", "!", "PARAMETERIZED_TYPE_CACHE_ENABLED", ")", "{", "return"...
Try to get the parameterized type from the cache. If no cached item found, cache and return the result of {@link #findParameterizedType(ClassNode, ClassNode, boolean)}
[ "Try", "to", "get", "the", "parameterized", "type", "from", "the", "cache", ".", "If", "no", "cached", "item", "found", "cache", "and", "return", "the", "result", "of", "{" ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java#L694-L702
apache/flink
flink-filesystems/flink-hadoop-fs/src/main/java/org/apache/flink/runtime/util/HadoopUtils.java
HadoopUtils.isMinHadoopVersion
public static boolean isMinHadoopVersion(int major, int minor) throws FlinkRuntimeException { """ Checks if the Hadoop dependency is at least of the given version. """ String versionString = VersionInfo.getVersion(); String[] versionParts = versionString.split("\\."); if (versionParts.length < 2) { t...
java
public static boolean isMinHadoopVersion(int major, int minor) throws FlinkRuntimeException { String versionString = VersionInfo.getVersion(); String[] versionParts = versionString.split("\\."); if (versionParts.length < 2) { throw new FlinkRuntimeException( "Cannot determine version of Hadoop, unexpecte...
[ "public", "static", "boolean", "isMinHadoopVersion", "(", "int", "major", ",", "int", "minor", ")", "throws", "FlinkRuntimeException", "{", "String", "versionString", "=", "VersionInfo", ".", "getVersion", "(", ")", ";", "String", "[", "]", "versionParts", "=", ...
Checks if the Hadoop dependency is at least of the given version.
[ "Checks", "if", "the", "Hadoop", "dependency", "is", "at", "least", "of", "the", "given", "version", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-hadoop-fs/src/main/java/org/apache/flink/runtime/util/HadoopUtils.java#L132-L145
looly/hutool
hutool-core/src/main/java/cn/hutool/core/lang/Console.java
Console.printProgress
public static void printProgress(char showChar, int totalLen, double rate) { """ 打印进度条 @param showChar 进度条提示字符,例如“#” @param totalLen 总长度 @param rate 总长度所占比取值0~1 @since 4.5.6 """ Assert.isTrue(rate >= 0 && rate <= 1, "Rate must between 0 and 1 (both include)"); printProgress(showChar, (int) (totalLe...
java
public static void printProgress(char showChar, int totalLen, double rate) { Assert.isTrue(rate >= 0 && rate <= 1, "Rate must between 0 and 1 (both include)"); printProgress(showChar, (int) (totalLen * rate)); }
[ "public", "static", "void", "printProgress", "(", "char", "showChar", ",", "int", "totalLen", ",", "double", "rate", ")", "{", "Assert", ".", "isTrue", "(", "rate", ">=", "0", "&&", "rate", "<=", "1", ",", "\"Rate must between 0 and 1 (both include)\"", ")", ...
打印进度条 @param showChar 进度条提示字符,例如“#” @param totalLen 总长度 @param rate 总长度所占比取值0~1 @since 4.5.6
[ "打印进度条" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Console.java#L74-L77
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/classify/LinearClassifier.java
LinearClassifier.probabilityOf
public Counter<L> probabilityOf(Datum<L, F> example) { """ Returns a counter mapping from each class name to the probability of that class for a certain example. Looking at the the sum of each count v, should be 1.0. """ if(example instanceof RVFDatum<?, ?>)return probabilityOfRVFDatum((RVFDatum<L,F>)ex...
java
public Counter<L> probabilityOf(Datum<L, F> example) { if(example instanceof RVFDatum<?, ?>)return probabilityOfRVFDatum((RVFDatum<L,F>)example); Counter<L> scores = logProbabilityOf(example); for (L label : scores.keySet()) { scores.setCount(label, Math.exp(scores.getCount(label))); } r...
[ "public", "Counter", "<", "L", ">", "probabilityOf", "(", "Datum", "<", "L", ",", "F", ">", "example", ")", "{", "if", "(", "example", "instanceof", "RVFDatum", "<", "?", ",", "?", ">", ")", "return", "probabilityOfRVFDatum", "(", "(", "RVFDatum", "<",...
Returns a counter mapping from each class name to the probability of that class for a certain example. Looking at the the sum of each count v, should be 1.0.
[ "Returns", "a", "counter", "mapping", "from", "each", "class", "name", "to", "the", "probability", "of", "that", "class", "for", "a", "certain", "example", ".", "Looking", "at", "the", "the", "sum", "of", "each", "count", "v", "should", "be", "1", ".", ...
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/classify/LinearClassifier.java#L249-L256
jenkinsci/jenkins
core/src/main/java/hudson/FilePath.java
FilePath.createZipArchive
@Deprecated public void createZipArchive(OutputStream os, final String glob) throws IOException, InterruptedException { """ Creates a zip file from this directory by only including the files that match the given glob. @param glob Ant style glob, like "**&#x2F;*.xml". If empty or null, this method works li...
java
@Deprecated public void createZipArchive(OutputStream os, final String glob) throws IOException, InterruptedException { archive(ArchiverFactory.ZIP,os,glob); }
[ "@", "Deprecated", "public", "void", "createZipArchive", "(", "OutputStream", "os", ",", "final", "String", "glob", ")", "throws", "IOException", ",", "InterruptedException", "{", "archive", "(", "ArchiverFactory", ".", "ZIP", ",", "os", ",", "glob", ")", ";",...
Creates a zip file from this directory by only including the files that match the given glob. @param glob Ant style glob, like "**&#x2F;*.xml". If empty or null, this method works like {@link #createZipArchive(OutputStream)} @since 1.129 @deprecated as of 1.315 Use {@link #zip(OutputStream,String)} that has more cons...
[ "Creates", "a", "zip", "file", "from", "this", "directory", "by", "only", "including", "the", "files", "that", "match", "the", "given", "glob", "." ]
train
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/FilePath.java#L448-L451
Azure/azure-sdk-for-java
appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java
AppServiceEnvironmentsInner.updateMultiRolePoolAsync
public Observable<WorkerPoolResourceInner> updateMultiRolePoolAsync(String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) { """ Create or update a multi-role pool. Create or update a multi-role pool. @param resourceGroupName Name of the resource group to which the resource belon...
java
public Observable<WorkerPoolResourceInner> updateMultiRolePoolAsync(String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) { return updateMultiRolePoolWithServiceResponseAsync(resourceGroupName, name, multiRolePoolEnvelope).map(new Func1<ServiceResponse<WorkerPoolResourceInner>, W...
[ "public", "Observable", "<", "WorkerPoolResourceInner", ">", "updateMultiRolePoolAsync", "(", "String", "resourceGroupName", ",", "String", "name", ",", "WorkerPoolResourceInner", "multiRolePoolEnvelope", ")", "{", "return", "updateMultiRolePoolWithServiceResponseAsync", "(", ...
Create or update a multi-role pool. Create or update a multi-role pool. @param resourceGroupName Name of the resource group to which the resource belongs. @param name Name of the App Service Environment. @param multiRolePoolEnvelope Properties of the multi-role pool. @throws IllegalArgumentException thrown if paramete...
[ "Create", "or", "update", "a", "multi", "-", "role", "pool", ".", "Create", "or", "update", "a", "multi", "-", "role", "pool", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L2485-L2492
Chorus-bdd/Chorus
interpreter/chorus-interpreter/src/main/java/org/chorusbdd/chorus/interpreter/interpreter/SpringContextSupport.java
SpringContextSupport.injectSpringResources
void injectSpringResources(Object handler, FeatureToken featureToken) throws Exception { """ Will load a Spring context from the named @ContextConfiguration resource. Will then inject the beans into fields annotated with @Resource where the name of the bean matches the name of the field. @param handler an inst...
java
void injectSpringResources(Object handler, FeatureToken featureToken) throws Exception { log.trace("Looking for SpringContext annotation on handler " + handler); Class<?> handlerClass = handler.getClass(); Annotation[] annotations = handlerClass.getAnnotations(); String contextFileName =...
[ "void", "injectSpringResources", "(", "Object", "handler", ",", "FeatureToken", "featureToken", ")", "throws", "Exception", "{", "log", ".", "trace", "(", "\"Looking for SpringContext annotation on handler \"", "+", "handler", ")", ";", "Class", "<", "?", ">", "hand...
Will load a Spring context from the named @ContextConfiguration resource. Will then inject the beans into fields annotated with @Resource where the name of the bean matches the name of the field. @param handler an instance of the handler class that will be used for testing
[ "Will", "load", "a", "Spring", "context", "from", "the", "named", "@ContextConfiguration", "resource", ".", "Will", "then", "inject", "the", "beans", "into", "fields", "annotated", "with", "@Resource", "where", "the", "name", "of", "the", "bean", "matches", "t...
train
https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-interpreter/src/main/java/org/chorusbdd/chorus/interpreter/interpreter/SpringContextSupport.java#L92-L101
wuman/orientdb-android
core/src/main/java/com/orientechnologies/orient/core/metadata/security/OUser.java
OUser.checkIfAllowed
public ORole checkIfAllowed(final String iResource, final int iOperation) { """ Checks if the user has the permission to access to the requested resource for the requested operation. @param iResource Requested resource @param iOperation Requested operation @return The role that has granted the permission if...
java
public ORole checkIfAllowed(final String iResource, final int iOperation) { for (ORole r : roles) if (r.allow(iResource, iOperation)) return r; return null; }
[ "public", "ORole", "checkIfAllowed", "(", "final", "String", "iResource", ",", "final", "int", "iOperation", ")", "{", "for", "(", "ORole", "r", ":", "roles", ")", "if", "(", "r", ".", "allow", "(", "iResource", ",", "iOperation", ")", ")", "return", "...
Checks if the user has the permission to access to the requested resource for the requested operation. @param iResource Requested resource @param iOperation Requested operation @return The role that has granted the permission if any, otherwise null
[ "Checks", "if", "the", "user", "has", "the", "permission", "to", "access", "to", "the", "requested", "resource", "for", "the", "requested", "operation", "." ]
train
https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/metadata/security/OUser.java#L122-L128
spring-projects/spring-android
spring-android-core/src/main/java/org/springframework/util/ConcurrentReferenceHashMap.java
ConcurrentReferenceHashMap.calculateShift
protected static int calculateShift(int minimumValue, int maximumValue) { """ Calculate a shift value that can be used to create a power-of-two value between the specified maximum and minimum values. @param minimumValue the minimum value @param maximumValue the maximum value @return the calculated shift (use {...
java
protected static int calculateShift(int minimumValue, int maximumValue) { int shift = 0; int value = 1; while (value < minimumValue && value < maximumValue) { value <<= 1; shift++; } return shift; }
[ "protected", "static", "int", "calculateShift", "(", "int", "minimumValue", ",", "int", "maximumValue", ")", "{", "int", "shift", "=", "0", ";", "int", "value", "=", "1", ";", "while", "(", "value", "<", "minimumValue", "&&", "value", "<", "maximumValue", ...
Calculate a shift value that can be used to create a power-of-two value between the specified maximum and minimum values. @param minimumValue the minimum value @param maximumValue the maximum value @return the calculated shift (use {@code 1 << shift} to obtain a value)
[ "Calculate", "a", "shift", "value", "that", "can", "be", "used", "to", "create", "a", "power", "-", "of", "-", "two", "value", "between", "the", "specified", "maximum", "and", "minimum", "values", "." ]
train
https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-core/src/main/java/org/springframework/util/ConcurrentReferenceHashMap.java#L383-L391
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/util/URLEncodedUtils.java
URLEncodedUtils.format
public static String format( final List <? extends NameValuePair> parameters, final String charset) { """ Returns a String that is suitable for use as an {@code application/x-www-form-urlencoded} list of parameters in an HTTP PUT or HTTP POST. @param parameters The parameters to includ...
java
public static String format( final List <? extends NameValuePair> parameters, final String charset) { return format(parameters, QP_SEP_A, charset); }
[ "public", "static", "String", "format", "(", "final", "List", "<", "?", "extends", "NameValuePair", ">", "parameters", ",", "final", "String", "charset", ")", "{", "return", "format", "(", "parameters", ",", "QP_SEP_A", ",", "charset", ")", ";", "}" ]
Returns a String that is suitable for use as an {@code application/x-www-form-urlencoded} list of parameters in an HTTP PUT or HTTP POST. @param parameters The parameters to include. @param charset The encoding to use. @return An {@code application/x-www-form-urlencoded} string
[ "Returns", "a", "String", "that", "is", "suitable", "for", "use", "as", "an", "{", "@code", "application", "/", "x", "-", "www", "-", "form", "-", "urlencoded", "}", "list", "of", "parameters", "in", "an", "HTTP", "PUT", "or", "HTTP", "POST", "." ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/URLEncodedUtils.java#L56-L60
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/HtmlDataSourceTag.java
HtmlDataSourceTag.nameHtmlControl
protected void nameHtmlControl(AbstractHtmlControlState state, ByRef javaScript) throws JspException { """ This method will create the name of the form element (HTML Control) that has a name. The <b>name</b> attribute represent the "control name" for the control. This name is scoped into the form el...
java
protected void nameHtmlControl(AbstractHtmlControlState state, ByRef javaScript) throws JspException { assert (javaScript != null) : "paramater 'javaScript' may not be null"; assert (state != null) : "parameter 'state' may not be null"; assert (_dataSource != null) : "dataSource ...
[ "protected", "void", "nameHtmlControl", "(", "AbstractHtmlControlState", "state", ",", "ByRef", "javaScript", ")", "throws", "JspException", "{", "assert", "(", "javaScript", "!=", "null", ")", ":", "\"paramater 'javaScript' may not be null\"", ";", "assert", "(", "st...
This method will create the name of the form element (HTML Control) that has a name. The <b>name</b> attribute represent the "control name" for the control. This name is scoped into the form element. In addition, a control may have a <b>id</b> attribute which is specified by setting the <b>tagId</b>. These two value...
[ "This", "method", "will", "create", "the", "name", "of", "the", "form", "element", "(", "HTML", "Control", ")", "that", "has", "a", "name", ".", "The", "<b", ">", "name<", "/", "b", ">", "attribute", "represent", "the", "control", "name", "for", "the",...
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/HtmlDataSourceTag.java#L131-L146
unbescape/unbescape
src/main/java/org/unbescape/uri/UriEscape.java
UriEscape.escapeUriFragmentId
public static void escapeUriFragmentId(final Reader reader, final Writer writer) throws IOException { """ <p> Perform am URI fragment identifier <strong>escape</strong> operation on a <tt>Reader</tt> input using <tt>UTF-8</tt> as encoding, writing results to a <tt>Writer</tt>. </p> <p> The follow...
java
public static void escapeUriFragmentId(final Reader reader, final Writer writer) throws IOException { escapeUriFragmentId(reader, writer, DEFAULT_ENCODING); }
[ "public", "static", "void", "escapeUriFragmentId", "(", "final", "Reader", "reader", ",", "final", "Writer", "writer", ")", "throws", "IOException", "{", "escapeUriFragmentId", "(", "reader", ",", "writer", ",", "DEFAULT_ENCODING", ")", ";", "}" ]
<p> Perform am URI fragment identifier <strong>escape</strong> operation on a <tt>Reader</tt> input using <tt>UTF-8</tt> as encoding, writing results to a <tt>Writer</tt>. </p> <p> The following are the only allowed chars in an URI fragment identifier (will not be escaped): </p> <ul> <li><tt>A-Z a-z 0-9</tt></li> <li><...
[ "<p", ">", "Perform", "am", "URI", "fragment", "identifier", "<strong", ">", "escape<", "/", "strong", ">", "operation", "on", "a", "<tt", ">", "Reader<", "/", "tt", ">", "input", "using", "<tt", ">", "UTF", "-", "8<", "/", "tt", ">", "as", "encoding...
train
https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/uri/UriEscape.java#L1056-L1059
intive-FDV/DynamicJasper
src/main/java/ar/com/fdvs/dj/domain/chart/builder/DJLineChartBuilder.java
DJLineChartBuilder.addSerie
public DJLineChartBuilder addSerie(AbstractColumn column, StringExpression labelExpression) { """ Adds the specified serie column to the dataset with custom label. @param column the serie column """ getDataset().addSerie(column, labelExpression); return this; }
java
public DJLineChartBuilder addSerie(AbstractColumn column, StringExpression labelExpression) { getDataset().addSerie(column, labelExpression); return this; }
[ "public", "DJLineChartBuilder", "addSerie", "(", "AbstractColumn", "column", ",", "StringExpression", "labelExpression", ")", "{", "getDataset", "(", ")", ".", "addSerie", "(", "column", ",", "labelExpression", ")", ";", "return", "this", ";", "}" ]
Adds the specified serie column to the dataset with custom label. @param column the serie column
[ "Adds", "the", "specified", "serie", "column", "to", "the", "dataset", "with", "custom", "label", "." ]
train
https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/domain/chart/builder/DJLineChartBuilder.java#L376-L379
elki-project/elki
elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/statistics/DistanceStatisticsWithClasses.java
DistanceStatisticsWithClasses.shrinkHeap
private static void shrinkHeap(TreeSet<DoubleDBIDPair> hotset, int k) { """ Shrink the heap of "hot" (extreme) items. @param hotset Set of hot items @param k target size """ // drop duplicates ModifiableDBIDs seenids = DBIDUtil.newHashSet(2 * k); int cnt = 0; for(Iterator<DoubleDBIDPair> i ...
java
private static void shrinkHeap(TreeSet<DoubleDBIDPair> hotset, int k) { // drop duplicates ModifiableDBIDs seenids = DBIDUtil.newHashSet(2 * k); int cnt = 0; for(Iterator<DoubleDBIDPair> i = hotset.iterator(); i.hasNext();) { DoubleDBIDPair p = i.next(); if(cnt > k || seenids.contains(p)) { ...
[ "private", "static", "void", "shrinkHeap", "(", "TreeSet", "<", "DoubleDBIDPair", ">", "hotset", ",", "int", "k", ")", "{", "// drop duplicates", "ModifiableDBIDs", "seenids", "=", "DBIDUtil", ".", "newHashSet", "(", "2", "*", "k", ")", ";", "int", "cnt", ...
Shrink the heap of "hot" (extreme) items. @param hotset Set of hot items @param k target size
[ "Shrink", "the", "heap", "of", "hot", "(", "extreme", ")", "items", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/statistics/DistanceStatisticsWithClasses.java#L382-L396
jtrfp/jfdt
src/main/java/org/jtrfp/jfdt/Parser.java
Parser.writeBean
public void writeBean(ThirdPartyParseable bean, EndianAwareDataOutputStream os) { """ Write ThirdPartyParseable bean to the given EndianAwareDataOutputStream. @param bean @param os @since Sep 17, 2012 """ if(bean==null)throw new NullPointerException(); ensureContextInstantiatedForWriting(os,bean); try...
java
public void writeBean(ThirdPartyParseable bean, EndianAwareDataOutputStream os){ if(bean==null)throw new NullPointerException(); ensureContextInstantiatedForWriting(os,bean); try{bean.describeFormat(this);} catch(UnrecognizedFormatException e){e.printStackTrace();}//Shouldn't happen. popBean(); }
[ "public", "void", "writeBean", "(", "ThirdPartyParseable", "bean", ",", "EndianAwareDataOutputStream", "os", ")", "{", "if", "(", "bean", "==", "null", ")", "throw", "new", "NullPointerException", "(", ")", ";", "ensureContextInstantiatedForWriting", "(", "os", ",...
Write ThirdPartyParseable bean to the given EndianAwareDataOutputStream. @param bean @param os @since Sep 17, 2012
[ "Write", "ThirdPartyParseable", "bean", "to", "the", "given", "EndianAwareDataOutputStream", "." ]
train
https://github.com/jtrfp/jfdt/blob/64e665669b5fcbfe96736346b4e7893e466dd8a0/src/main/java/org/jtrfp/jfdt/Parser.java#L185-L191
DDTH/ddth-commons
ddth-commons-core/src/main/java/com/github/ddth/commons/utils/JacksonUtils.java
JacksonUtils.getValue
public static JsonNode getValue(JsonNode node, String dPath) { """ Extract a value from the target {@link JsonNode} using DPath expression. @param node @param dPath @see DPathUtils """ return DPathUtils.getValue(node, dPath); }
java
public static JsonNode getValue(JsonNode node, String dPath) { return DPathUtils.getValue(node, dPath); }
[ "public", "static", "JsonNode", "getValue", "(", "JsonNode", "node", ",", "String", "dPath", ")", "{", "return", "DPathUtils", ".", "getValue", "(", "node", ",", "dPath", ")", ";", "}" ]
Extract a value from the target {@link JsonNode} using DPath expression. @param node @param dPath @see DPathUtils
[ "Extract", "a", "value", "from", "the", "target", "{", "@link", "JsonNode", "}", "using", "DPath", "expression", "." ]
train
https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/JacksonUtils.java#L260-L262
coursera/courier
generator-api/src/main/java/org/coursera/courier/api/CourierTemplateSpecGenerator.java
CourierTemplateSpecGenerator.nullTypeNotAllowed
private static IllegalArgumentException nullTypeNotAllowed(ClassTemplateSpec enclosingClass, String memberName) { """ /* Return exception for trying to use null type outside of a union. """ return new IllegalArgumentException("The null type can only be used in unions, null found" + enclosingClassAndMember...
java
private static IllegalArgumentException nullTypeNotAllowed(ClassTemplateSpec enclosingClass, String memberName) { return new IllegalArgumentException("The null type can only be used in unions, null found" + enclosingClassAndMemberNameToString(enclosingClass, memberName)); }
[ "private", "static", "IllegalArgumentException", "nullTypeNotAllowed", "(", "ClassTemplateSpec", "enclosingClass", ",", "String", "memberName", ")", "{", "return", "new", "IllegalArgumentException", "(", "\"The null type can only be used in unions, null found\"", "+", "enclosingC...
/* Return exception for trying to use null type outside of a union.
[ "/", "*", "Return", "exception", "for", "trying", "to", "use", "null", "type", "outside", "of", "a", "union", "." ]
train
https://github.com/coursera/courier/blob/749674fa7ee33804ad11b6c8ecb560f455cb4c22/generator-api/src/main/java/org/coursera/courier/api/CourierTemplateSpecGenerator.java#L251-L254
MutabilityDetector/MutabilityDetector
src/main/java/org/mutabilitydetector/checkers/settermethod/AliasFinder.java
AliasFinder.newInstance
public static AliasFinder newInstance(final String variableName, final ControlFlowBlock controlFlowBlockToExamine) { """ Creates a new instance of this class. @param variableName name of the instance variable to search aliases for. Must neither be {@code null} nor empty. @param controlFlowBlockToExamine a {...
java
public static AliasFinder newInstance(final String variableName, final ControlFlowBlock controlFlowBlockToExamine) { checkArgument(!variableName.isEmpty()); return new AliasFinder(variableName, checkNotNull(controlFlowBlockToExamine)); }
[ "public", "static", "AliasFinder", "newInstance", "(", "final", "String", "variableName", ",", "final", "ControlFlowBlock", "controlFlowBlockToExamine", ")", "{", "checkArgument", "(", "!", "variableName", ".", "isEmpty", "(", ")", ")", ";", "return", "new", "Alia...
Creates a new instance of this class. @param variableName name of the instance variable to search aliases for. Must neither be {@code null} nor empty. @param controlFlowBlockToExamine a {@link ControlFlowBlock} which possibly contains the setup of an alias for a lazy variable. This method thereby examines predecessors...
[ "Creates", "a", "new", "instance", "of", "this", "class", "." ]
train
https://github.com/MutabilityDetector/MutabilityDetector/blob/36014d2f9e45cf0cc6d67b81395942cd39c4f6ae/src/main/java/org/mutabilitydetector/checkers/settermethod/AliasFinder.java#L74-L77
nats-io/java-nats
src/main/java/io/nats/client/impl/FileAuthHandler.java
FileAuthHandler.getID
public char[] getID() { """ getID should return a public key associated with a client key known to the server. If the server is not in nonce-mode, this array can be empty. @return the public key as a char array """ try { char[] keyChars = this.readKeyChars(); NKey nkey = NK...
java
public char[] getID() { try { char[] keyChars = this.readKeyChars(); NKey nkey = NKey.fromSeed(keyChars); char[] pubKey = nkey.getPublicKey(); nkey.clear(); return pubKey; } catch (Exception exp) { throw new IllegalStateException("...
[ "public", "char", "[", "]", "getID", "(", ")", "{", "try", "{", "char", "[", "]", "keyChars", "=", "this", ".", "readKeyChars", "(", ")", ";", "NKey", "nkey", "=", "NKey", ".", "fromSeed", "(", "keyChars", ")", ";", "char", "[", "]", "pubKey", "=...
getID should return a public key associated with a client key known to the server. If the server is not in nonce-mode, this array can be empty. @return the public key as a char array
[ "getID", "should", "return", "a", "public", "key", "associated", "with", "a", "client", "key", "known", "to", "the", "server", ".", "If", "the", "server", "is", "not", "in", "nonce", "-", "mode", "this", "array", "can", "be", "empty", "." ]
train
https://github.com/nats-io/java-nats/blob/5f291048fd30192ba39b3fe2925ecd60aaad6b48/src/main/java/io/nats/client/impl/FileAuthHandler.java#L170-L180
RestComm/sipunit
src/main/java/org/cafesip/sipunit/SipAssert.java
SipAssert.assertHeaderNotPresent
public static void assertHeaderNotPresent(String msg, SipMessage sipMessage, String header) { """ Asserts that the given SIP message contains no occurrence of the specified header. Assertion failure output includes the given message text. @param msg message text to output if the assertion fails. @param sipMes...
java
public static void assertHeaderNotPresent(String msg, SipMessage sipMessage, String header) { assertNotNull("Null assert object passed in", sipMessage); assertFalse(msg, sipMessage.getHeaders(header).hasNext()); }
[ "public", "static", "void", "assertHeaderNotPresent", "(", "String", "msg", ",", "SipMessage", "sipMessage", ",", "String", "header", ")", "{", "assertNotNull", "(", "\"Null assert object passed in\"", ",", "sipMessage", ")", ";", "assertFalse", "(", "msg", ",", "...
Asserts that the given SIP message contains no occurrence of the specified header. Assertion failure output includes the given message text. @param msg message text to output if the assertion fails. @param sipMessage the SIP message. @param header the string identifying the header as specified in RFC-3261.
[ "Asserts", "that", "the", "given", "SIP", "message", "contains", "no", "occurrence", "of", "the", "specified", "header", ".", "Assertion", "failure", "output", "includes", "the", "given", "message", "text", "." ]
train
https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipAssert.java#L146-L149
dwdyer/watchmaker
swing/src/java/main/org/uncommons/watchmaker/swing/evolutionmonitor/PopulationFitnessView.java
PopulationFitnessView.createControls
private JComponent createControls(boolean islands) { """ Creates the GUI controls for toggling graph display options. @return A component that can be added to the main panel. """ JPanel controls = new JPanel(new FlowLayout(FlowLayout.RIGHT)); allDataButton.addItemListener(new ItemListener() ...
java
private JComponent createControls(boolean islands) { JPanel controls = new JPanel(new FlowLayout(FlowLayout.RIGHT)); allDataButton.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent ev) { updateDomainAxisRange(); }...
[ "private", "JComponent", "createControls", "(", "boolean", "islands", ")", "{", "JPanel", "controls", "=", "new", "JPanel", "(", "new", "FlowLayout", "(", "FlowLayout", ".", "RIGHT", ")", ")", ";", "allDataButton", ".", "addItemListener", "(", "new", "ItemList...
Creates the GUI controls for toggling graph display options. @return A component that can be added to the main panel.
[ "Creates", "the", "GUI", "controls", "for", "toggling", "graph", "display", "options", "." ]
train
https://github.com/dwdyer/watchmaker/blob/33d942350e6bf7d9a17b9262a4f898158530247e/swing/src/java/main/org/uncommons/watchmaker/swing/evolutionmonitor/PopulationFitnessView.java#L105-L152
olivergondza/dumpling
cli/src/main/java/com/github/olivergondza/dumpling/groovy/InterpretterConfig.java
InterpretterConfig.getDefaultBinding
public Binding getDefaultBinding(@Nonnull ProcessStream stream, @Nonnull List<String> args, @Nullable ProcessRuntime<?, ?, ?> runtime) { """ Default binding to be used in groovy interpreters. Dumpling exposed API is available via <tt>D</tt> property. """ Binding binding = new Binding(); bind...
java
public Binding getDefaultBinding(@Nonnull ProcessStream stream, @Nonnull List<String> args, @Nullable ProcessRuntime<?, ?, ?> runtime) { Binding binding = new Binding(); binding.setProperty("out", stream.out()); binding.setProperty("err", stream.err()); binding.setProperty("D", new Groo...
[ "public", "Binding", "getDefaultBinding", "(", "@", "Nonnull", "ProcessStream", "stream", ",", "@", "Nonnull", "List", "<", "String", ">", "args", ",", "@", "Nullable", "ProcessRuntime", "<", "?", ",", "?", ",", "?", ">", "runtime", ")", "{", "Binding", ...
Default binding to be used in groovy interpreters. Dumpling exposed API is available via <tt>D</tt> property.
[ "Default", "binding", "to", "be", "used", "in", "groovy", "interpreters", "." ]
train
https://github.com/olivergondza/dumpling/blob/ac698735fcc7c023db0c1637cc1f522cb3576c7f/cli/src/main/java/com/github/olivergondza/dumpling/groovy/InterpretterConfig.java#L48-L56
spotify/helios
helios-services/src/main/java/com/spotify/helios/master/ZooKeeperMasterModel.java
ZooKeeperMasterModel.registerHost
@Override public void registerHost(final String host, final String id) { """ Registers a host into ZooKeeper. The {@code id} is initially generated randomly by the Agent and persisted on disk. This way, in the event that you have two agents attempting to register with the same value of @{code host}, the firs...
java
@Override public void registerHost(final String host, final String id) { final ZooKeeperClient client = provider.get("registerHost"); try { ZooKeeperRegistrarUtil.registerHost(client, Paths.configHostId(host), host, id); } catch (Exception e) { throw new HeliosRuntimeException("registering hos...
[ "@", "Override", "public", "void", "registerHost", "(", "final", "String", "host", ",", "final", "String", "id", ")", "{", "final", "ZooKeeperClient", "client", "=", "provider", ".", "get", "(", "\"registerHost\"", ")", ";", "try", "{", "ZooKeeperRegistrarUtil...
Registers a host into ZooKeeper. The {@code id} is initially generated randomly by the Agent and persisted on disk. This way, in the event that you have two agents attempting to register with the same value of @{code host}, the first one will win.
[ "Registers", "a", "host", "into", "ZooKeeper", ".", "The", "{" ]
train
https://github.com/spotify/helios/blob/c9000bc1d6908651570be8b057d4981bba4df5b4/helios-services/src/main/java/com/spotify/helios/master/ZooKeeperMasterModel.java#L181-L189
amlinv/registry-utils
src/main/java/com/amlinv/registry/util/ConcurrentRegistry.java
ConcurrentRegistry.putIfAbsent
public V putIfAbsent (K putKey, V putValue) { """ Add the given entry into the registry under the specified key, but only if the key is not already registered. @param putKey key identifying the entry in the registry to add, if it does not already exist. @param putValue value to add to the registry. @return ex...
java
public V putIfAbsent (K putKey, V putValue) { V existingValue = this.store.putIfAbsent(putKey, putValue); if ( existingValue == null ) { this.notificationExecutor.firePutNotification(this.listeners.iterator(), putKey, putValue); } return existingValue; }
[ "public", "V", "putIfAbsent", "(", "K", "putKey", ",", "V", "putValue", ")", "{", "V", "existingValue", "=", "this", ".", "store", ".", "putIfAbsent", "(", "putKey", ",", "putValue", ")", ";", "if", "(", "existingValue", "==", "null", ")", "{", "this",...
Add the given entry into the registry under the specified key, but only if the key is not already registered. @param putKey key identifying the entry in the registry to add, if it does not already exist. @param putValue value to add to the registry. @return existing value in the registry if already defined; null if th...
[ "Add", "the", "given", "entry", "into", "the", "registry", "under", "the", "specified", "key", "but", "only", "if", "the", "key", "is", "not", "already", "registered", "." ]
train
https://github.com/amlinv/registry-utils/blob/784c455be38acb0df3a35c38afe60a516b8e4f32/src/main/java/com/amlinv/registry/util/ConcurrentRegistry.java#L153-L161
liyiorg/weixin-popular
src/main/java/weixin/popular/util/XMLConverUtil.java
XMLConverUtil.convertToObject
public static <T> T convertToObject(Class<T> clazz, String xml) { """ XML to Object @param <T> T @param clazz clazz @param xml xml @return T """ return convertToObject(clazz, new StringReader(xml)); }
java
public static <T> T convertToObject(Class<T> clazz, String xml) { return convertToObject(clazz, new StringReader(xml)); }
[ "public", "static", "<", "T", ">", "T", "convertToObject", "(", "Class", "<", "T", ">", "clazz", ",", "String", "xml", ")", "{", "return", "convertToObject", "(", "clazz", ",", "new", "StringReader", "(", "xml", ")", ")", ";", "}" ]
XML to Object @param <T> T @param clazz clazz @param xml xml @return T
[ "XML", "to", "Object" ]
train
https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/util/XMLConverUtil.java#L62-L64
teatrove/teatrove
tea/src/main/java/org/teatrove/tea/compiler/Compiler.java
Compiler.createSourceReader
protected SourceReader createSourceReader(CompilationUnit unit) throws IOException { """ Default implementation returns a SourceReader that uses "<%" and "%>" as code delimiters. """ Reader r = new BufferedReader(unit.getReader()); return new SourceReader(r, "<%", "%>"); }
java
protected SourceReader createSourceReader(CompilationUnit unit) throws IOException { Reader r = new BufferedReader(unit.getReader()); return new SourceReader(r, "<%", "%>"); }
[ "protected", "SourceReader", "createSourceReader", "(", "CompilationUnit", "unit", ")", "throws", "IOException", "{", "Reader", "r", "=", "new", "BufferedReader", "(", "unit", ".", "getReader", "(", ")", ")", ";", "return", "new", "SourceReader", "(", "r", ","...
Default implementation returns a SourceReader that uses "<%" and "%>" as code delimiters.
[ "Default", "implementation", "returns", "a", "SourceReader", "that", "uses", "<%", "and", "%", ">", "as", "code", "delimiters", "." ]
train
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/tea/src/main/java/org/teatrove/tea/compiler/Compiler.java#L859-L864
sahan/IckleBot
icklebot/src/main/java/com/lonepulse/icklebot/fragment/EventFragment.java
EventFragment.onViewCreated
@Override public void onViewCreated(View view, Bundle savedInstanceState) { """ <p>Performs <b>event listener linking</b> by invoking {@link EventUtils#link()}.</p> """ super.onViewCreated(view, savedInstanceState); EventUtils.link(EVENT_CONFIGURATION); }
java
@Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); EventUtils.link(EVENT_CONFIGURATION); }
[ "@", "Override", "public", "void", "onViewCreated", "(", "View", "view", ",", "Bundle", "savedInstanceState", ")", "{", "super", ".", "onViewCreated", "(", "view", ",", "savedInstanceState", ")", ";", "EventUtils", ".", "link", "(", "EVENT_CONFIGURATION", ")", ...
<p>Performs <b>event listener linking</b> by invoking {@link EventUtils#link()}.</p>
[ "<p", ">", "Performs", "<b", ">", "event", "listener", "linking<", "/", "b", ">", "by", "invoking", "{" ]
train
https://github.com/sahan/IckleBot/blob/a19003ceb3ad7c7ee508dc23a8cb31b5676aa499/icklebot/src/main/java/com/lonepulse/icklebot/fragment/EventFragment.java#L65-L70
eurekaclinical/aiw-i2b2-etl
src/main/java/edu/emory/cci/aiw/i2b2etl/dest/metadata/conceptid/PropDefConceptId.java
PropDefConceptId.getInstance
public static PropDefConceptId getInstance(String propId, String propertyName, Value value, Metadata metadata) { """ Returns a concept propId with the given proposition propId, property name and value. @param propId a proposition propId {@link String}. Cannot be <code>null</code>. @param property...
java
public static PropDefConceptId getInstance(String propId, String propertyName, Value value, Metadata metadata) { List<Object> key = new ArrayList<>(4); key.add(propId); key.add(propertyName); key.add(value); key.add(Boolean.TRUE); //distinguishes these from properties...
[ "public", "static", "PropDefConceptId", "getInstance", "(", "String", "propId", ",", "String", "propertyName", ",", "Value", "value", ",", "Metadata", "metadata", ")", "{", "List", "<", "Object", ">", "key", "=", "new", "ArrayList", "<>", "(", "4", ")", ";...
Returns a concept propId with the given proposition propId, property name and value. @param propId a proposition propId {@link String}. Cannot be <code>null</code>. @param propertyName a property name {@link String}. @param value a {@link Value}. @return a {@link PropDefConceptId}.
[ "Returns", "a", "concept", "propId", "with", "the", "given", "proposition", "propId", "property", "name", "and", "value", "." ]
train
https://github.com/eurekaclinical/aiw-i2b2-etl/blob/3eed6bda7755919cb9466d2930723a0f4748341a/src/main/java/edu/emory/cci/aiw/i2b2etl/dest/metadata/conceptid/PropDefConceptId.java#L67-L80
looly/hutool
hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/AbstractAsymmetricCrypto.java
AbstractAsymmetricCrypto.encryptBcd
public String encryptBcd(String data, KeyType keyType) { """ 分组加密 @param data 数据 @param keyType 密钥类型 @return 加密后的密文 @throws CryptoException 加密异常 @since 4.1.0 """ return encryptBcd(data, keyType, CharsetUtil.CHARSET_UTF_8); }
java
public String encryptBcd(String data, KeyType keyType) { return encryptBcd(data, keyType, CharsetUtil.CHARSET_UTF_8); }
[ "public", "String", "encryptBcd", "(", "String", "data", ",", "KeyType", "keyType", ")", "{", "return", "encryptBcd", "(", "data", ",", "keyType", ",", "CharsetUtil", ".", "CHARSET_UTF_8", ")", ";", "}" ]
分组加密 @param data 数据 @param keyType 密钥类型 @return 加密后的密文 @throws CryptoException 加密异常 @since 4.1.0
[ "分组加密" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/AbstractAsymmetricCrypto.java#L198-L200
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java
SegmentAggregator.reconcileAppendOperation
private CompletableFuture<WriterFlushResult> reconcileAppendOperation(AggregatedAppendOperation op, SegmentProperties storageInfo, TimeoutTimer timer) { """ Attempts to reconcile data and attributes for the given AggregatedAppendOperation. Since Append Operations can be partially flushed, reconciliation may be fo...
java
private CompletableFuture<WriterFlushResult> reconcileAppendOperation(AggregatedAppendOperation op, SegmentProperties storageInfo, TimeoutTimer timer) { CompletableFuture<Boolean> reconcileResult; WriterFlushResult flushResult = new WriterFlushResult(); if (op.getLength() > 0) { // T...
[ "private", "CompletableFuture", "<", "WriterFlushResult", ">", "reconcileAppendOperation", "(", "AggregatedAppendOperation", "op", ",", "SegmentProperties", "storageInfo", ",", "TimeoutTimer", "timer", ")", "{", "CompletableFuture", "<", "Boolean", ">", "reconcileResult", ...
Attempts to reconcile data and attributes for the given AggregatedAppendOperation. Since Append Operations can be partially flushed, reconciliation may be for the full operation or for a part of it. @param op The AggregatedAppendOperation to reconcile. @param storageInfo The current state of the Segment in St...
[ "Attempts", "to", "reconcile", "data", "and", "attributes", "for", "the", "given", "AggregatedAppendOperation", ".", "Since", "Append", "Operations", "can", "be", "partially", "flushed", "reconciliation", "may", "be", "for", "the", "full", "operation", "or", "for"...
train
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L1306-L1344
rvs-fluid-it/mvn-fluid-cd
mvn-ext-freeze/src/main/java/be/fluid_it/mvn/cd/x/freeze/replace/FreezeHandler.java
FreezeHandler.processingInstruction
public void processingInstruction(String target, String data) throws SAXException { """ Overrides <code>processingInstruction(String <i>target</i>, String <i>data</i>)</code> in <code>org.xml.sax.helpers.DefaultHandler</code>, which in turn implements <code>org.xml.sax.ContentHandler</code>. Calle...
java
public void processingInstruction(String target, String data) throws SAXException { write(nl + " <?" + target + " " + data + "?>"); }
[ "public", "void", "processingInstruction", "(", "String", "target", ",", "String", "data", ")", "throws", "SAXException", "{", "write", "(", "nl", "+", "\" <?\"", "+", "target", "+", "\" \"", "+", "data", "+", "\"?>\"", ")", ";", "}" ]
Overrides <code>processingInstruction(String <i>target</i>, String <i>data</i>)</code> in <code>org.xml.sax.helpers.DefaultHandler</code>, which in turn implements <code>org.xml.sax.ContentHandler</code>. Called whenever a processing instruction (PI) is encountered.
[ "Overrides", "<code", ">", "processingInstruction", "(", "String", "<i", ">", "target<", "/", "i", ">", "String", "<i", ">", "data<", "/", "i", ">", ")", "<", "/", "code", ">", "in", "<code", ">", "org", ".", "xml", ".", "sax", ".", "helpers", ".",...
train
https://github.com/rvs-fluid-it/mvn-fluid-cd/blob/2aad8ed1cb40f94bd24bad7e6a127956cc277077/mvn-ext-freeze/src/main/java/be/fluid_it/mvn/cd/x/freeze/replace/FreezeHandler.java#L64-L67
BBN-E/bue-common-open
common-core-open/src/main/java/com/bbn/bue/common/files/FileUtils.java
FileUtils.writeSymbolToFileMap
public static void writeSymbolToFileMap(Map<Symbol, File> symbolToFileMap, CharSink sink) throws IOException { """ Writes a map from symbols to file absolute paths to a file. Each line has a mapping with the key and value separated by a single tab. The file will have a trailing newline. """ writeSymbolTo...
java
public static void writeSymbolToFileMap(Map<Symbol, File> symbolToFileMap, CharSink sink) throws IOException { writeSymbolToFileEntries(symbolToFileMap.entrySet(), sink); }
[ "public", "static", "void", "writeSymbolToFileMap", "(", "Map", "<", "Symbol", ",", "File", ">", "symbolToFileMap", ",", "CharSink", "sink", ")", "throws", "IOException", "{", "writeSymbolToFileEntries", "(", "symbolToFileMap", ".", "entrySet", "(", ")", ",", "s...
Writes a map from symbols to file absolute paths to a file. Each line has a mapping with the key and value separated by a single tab. The file will have a trailing newline.
[ "Writes", "a", "map", "from", "symbols", "to", "file", "absolute", "paths", "to", "a", "file", ".", "Each", "line", "has", "a", "mapping", "with", "the", "key", "and", "value", "separated", "by", "a", "single", "tab", ".", "The", "file", "will", "have"...
train
https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/files/FileUtils.java#L243-L245
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/URI.java
URI.setPort
public void setPort(int p_port) throws MalformedURIException { """ Set the port for this URI. -1 is used to indicate that the port is not specified, otherwise valid port numbers are between 0 and 65535. If a valid port number is passed in and the host field is null, an exception is thrown. @param p_port the...
java
public void setPort(int p_port) throws MalformedURIException { if (p_port >= 0 && p_port <= 65535) { if (m_host == null) { throw new MalformedURIException( XMLMessages.createXMLMessage(XMLErrorResources.ER_PORT_WHEN_HOST_NULL, null)); //"Port cannot be set when host is null!"); ...
[ "public", "void", "setPort", "(", "int", "p_port", ")", "throws", "MalformedURIException", "{", "if", "(", "p_port", ">=", "0", "&&", "p_port", "<=", "65535", ")", "{", "if", "(", "m_host", "==", "null", ")", "{", "throw", "new", "MalformedURIException", ...
Set the port for this URI. -1 is used to indicate that the port is not specified, otherwise valid port numbers are between 0 and 65535. If a valid port number is passed in and the host field is null, an exception is thrown. @param p_port the port number for this URI @throws MalformedURIException if p_port is not -1 ...
[ "Set", "the", "port", "for", "this", "URI", ".", "-", "1", "is", "used", "to", "indicate", "that", "the", "port", "is", "not", "specified", "otherwise", "valid", "port", "numbers", "are", "between", "0", "and", "65535", ".", "If", "a", "valid", "port",...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/URI.java#L1146-L1163
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/time/DateUtils.java
DateUtils.getFragmentInMilliseconds
@GwtIncompatible("incompatible method") public static long getFragmentInMilliseconds(final Date date, final int fragment) { """ <p>Returns the number of milliseconds within the fragment. All datefields greater than the fragment will be ignored.</p> <p>Asking the milliseconds of any date will only return th...
java
@GwtIncompatible("incompatible method") public static long getFragmentInMilliseconds(final Date date, final int fragment) { return getFragment(date, fragment, TimeUnit.MILLISECONDS); }
[ "@", "GwtIncompatible", "(", "\"incompatible method\"", ")", "public", "static", "long", "getFragmentInMilliseconds", "(", "final", "Date", "date", ",", "final", "int", "fragment", ")", "{", "return", "getFragment", "(", "date", ",", "fragment", ",", "TimeUnit", ...
<p>Returns the number of milliseconds within the fragment. All datefields greater than the fragment will be ignored.</p> <p>Asking the milliseconds of any date will only return the number of milliseconds of the current second (resulting in a number between 0 and 999). This method will retrieve the number of millisecon...
[ "<p", ">", "Returns", "the", "number", "of", "milliseconds", "within", "the", "fragment", ".", "All", "datefields", "greater", "than", "the", "fragment", "will", "be", "ignored", ".", "<", "/", "p", ">" ]
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/time/DateUtils.java#L1296-L1299
looly/hutool
hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/SM2Engine.java
SM2Engine.init
public void init(boolean forEncryption, CipherParameters param) { """ 初始化引擎 @param forEncryption 是否为加密模式 @param param {@link CipherParameters},此处应为{@link ParametersWithRandom}(加密时)或{@link ECKeyParameters}(解密时) """ this.forEncryption = forEncryption; if (param instanceof ParametersWithRandom) { ...
java
public void init(boolean forEncryption, CipherParameters param) { this.forEncryption = forEncryption; if (param instanceof ParametersWithRandom) { final ParametersWithRandom rParam = (ParametersWithRandom) param; this.ecKey = (ECKeyParameters) rParam.getParameters(); this.random = rParam.getRandom()...
[ "public", "void", "init", "(", "boolean", "forEncryption", ",", "CipherParameters", "param", ")", "{", "this", ".", "forEncryption", "=", "forEncryption", ";", "if", "(", "param", "instanceof", "ParametersWithRandom", ")", "{", "final", "ParametersWithRandom", "rP...
初始化引擎 @param forEncryption 是否为加密模式 @param param {@link CipherParameters},此处应为{@link ParametersWithRandom}(加密时)或{@link ECKeyParameters}(解密时)
[ "初始化引擎" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/SM2Engine.java#L94-L121
gosu-lang/gosu-lang
gosu-core-api/src/main/java/gw/util/StreamUtil.java
StreamUtil.copy
public static void copy(Reader reader, OutputStream out) throws IOException { """ Copies the content of a reader to an output stream. @param reader the reader to read @param out the output stream to write @throws java.io.IOException if an I/O error occurs """ copy(reader, getOutputStreamWriter(out)); ...
java
public static void copy(Reader reader, OutputStream out) throws IOException { copy(reader, getOutputStreamWriter(out)); out.flush(); }
[ "public", "static", "void", "copy", "(", "Reader", "reader", ",", "OutputStream", "out", ")", "throws", "IOException", "{", "copy", "(", "reader", ",", "getOutputStreamWriter", "(", "out", ")", ")", ";", "out", ".", "flush", "(", ")", ";", "}" ]
Copies the content of a reader to an output stream. @param reader the reader to read @param out the output stream to write @throws java.io.IOException if an I/O error occurs
[ "Copies", "the", "content", "of", "a", "reader", "to", "an", "output", "stream", "." ]
train
https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/util/StreamUtil.java#L220-L223
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/resizable/ResizableContainment.java
ResizableContainment.setParam
private void setParam(ElementEnum elementEnumParam, String objectParam, LiteralOption selector) { """ Method setting the right parameter @param elementEnumParam elementEnum parameter @param objectParam object parameter @param selector Selector """ this.elementEnumParam = elementEnumParam; this.obje...
java
private void setParam(ElementEnum elementEnumParam, String objectParam, LiteralOption selector) { this.elementEnumParam = elementEnumParam; this.objectParam = objectParam; this.selector = selector; }
[ "private", "void", "setParam", "(", "ElementEnum", "elementEnumParam", ",", "String", "objectParam", ",", "LiteralOption", "selector", ")", "{", "this", ".", "elementEnumParam", "=", "elementEnumParam", ";", "this", ".", "objectParam", "=", "objectParam", ";", "th...
Method setting the right parameter @param elementEnumParam elementEnum parameter @param objectParam object parameter @param selector Selector
[ "Method", "setting", "the", "right", "parameter" ]
train
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/resizable/ResizableContainment.java#L222-L227
Metatavu/edelphi
rest/src/main/java/fi/metatavu/edelphi/users/UserController.java
UserController.getUserKeycloakId
public UUID getUserKeycloakId(User user) { """ Returns Keycloak id for an user @param user user @return Keycloak id or null if id could not be resolved """ AuthSource authSource = authSourceDAO.findByStrategy(KEYCLOAK_AUTH_SOURCE); if (authSource == null) { logger.error("Could not find Keyclo...
java
public UUID getUserKeycloakId(User user) { AuthSource authSource = authSourceDAO.findByStrategy(KEYCLOAK_AUTH_SOURCE); if (authSource == null) { logger.error("Could not find Keycloak auth source"); } List<UserIdentification> userIdentifications = userIdentificationDAO.listByUserAndAuthSource(...
[ "public", "UUID", "getUserKeycloakId", "(", "User", "user", ")", "{", "AuthSource", "authSource", "=", "authSourceDAO", ".", "findByStrategy", "(", "KEYCLOAK_AUTH_SOURCE", ")", ";", "if", "(", "authSource", "==", "null", ")", "{", "logger", ".", "error", "(", ...
Returns Keycloak id for an user @param user user @return Keycloak id or null if id could not be resolved
[ "Returns", "Keycloak", "id", "for", "an", "user" ]
train
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/users/UserController.java#L62-L78
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/util/TileSystem.java
TileSystem.PixelXYToLatLong
@Deprecated public GeoPoint PixelXYToLatLong( final int pixelX, final int pixelY, final int levelOfDetail, final GeoPoint reuse) { """ Use {@link TileSystem#getGeoFromMercator(long, long, double, GeoPoint, boolean, boolean)} instead """ return getGeoFromMercator(pixelX, pixelY, MapSize(levelOfDetail), re...
java
@Deprecated public GeoPoint PixelXYToLatLong( final int pixelX, final int pixelY, final int levelOfDetail, final GeoPoint reuse) { return getGeoFromMercator(pixelX, pixelY, MapSize(levelOfDetail), reuse, true, true); }
[ "@", "Deprecated", "public", "GeoPoint", "PixelXYToLatLong", "(", "final", "int", "pixelX", ",", "final", "int", "pixelY", ",", "final", "int", "levelOfDetail", ",", "final", "GeoPoint", "reuse", ")", "{", "return", "getGeoFromMercator", "(", "pixelX", ",", "p...
Use {@link TileSystem#getGeoFromMercator(long, long, double, GeoPoint, boolean, boolean)} instead
[ "Use", "{" ]
train
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/TileSystem.java#L185-L189
davidcarboni/cryptolite-java
src/main/java/com/github/davidcarboni/cryptolite/Keys.java
Keys.newKeyPair
public static KeyPair newKeyPair() { """ Generates a new public-private (or asymmetric) key pair for use with {@value #ASYMMETRIC_ALGORITHM}. <p> The key size will be {@value #ASYMMETRIC_KEY_SIZE} bits. <p> BouncyCastle will automatically generate a "Chinese Remainder Theorem" or CRT key, which makes using a ...
java
public static KeyPair newKeyPair() { // Construct a key generator KeyPairGenerator keyPairGenerator; try { keyPairGenerator = KeyPairGenerator.getInstance(ASYMMETRIC_ALGORITHM); keyPairGenerator.initialize(ASYMMETRIC_KEY_SIZE); } catch (NoSuchAlgorithmExce...
[ "public", "static", "KeyPair", "newKeyPair", "(", ")", "{", "// Construct a key generator\r", "KeyPairGenerator", "keyPairGenerator", ";", "try", "{", "keyPairGenerator", "=", "KeyPairGenerator", ".", "getInstance", "(", "ASYMMETRIC_ALGORITHM", ")", ";", "keyPairGenerator...
Generates a new public-private (or asymmetric) key pair for use with {@value #ASYMMETRIC_ALGORITHM}. <p> The key size will be {@value #ASYMMETRIC_KEY_SIZE} bits. <p> BouncyCastle will automatically generate a "Chinese Remainder Theorem" or CRT key, which makes using a symmetric encryption significantly faster. @return...
[ "Generates", "a", "new", "public", "-", "private", "(", "or", "asymmetric", ")", "key", "pair", "for", "use", "with", "{", "@value", "#ASYMMETRIC_ALGORITHM", "}", ".", "<p", ">", "The", "key", "size", "will", "be", "{", "@value", "#ASYMMETRIC_KEY_SIZE", "}...
train
https://github.com/davidcarboni/cryptolite-java/blob/e67954181a04ffc9beb1d9abca1421195fcf9764/src/main/java/com/github/davidcarboni/cryptolite/Keys.java#L227-L246
gallandarakhneorg/afc
advanced/gis/gisroad/src/main/java/org/arakhne/afc/gis/road/StandardRoadConnection.java
StandardRoadConnection.removeConnectedSegment
int removeConnectedSegment(RoadSegment segment, boolean attachToStartPoint) { """ Remove a connection with a segment. @param segment is the segment to remove. @param attachToStartPoint indicates if the segment is attached by its start point (if value is <code>true</code>) or by its end point @return the inde...
java
int removeConnectedSegment(RoadSegment segment, boolean attachToStartPoint) { if (segment == null) { return -1; } final int idx = indexOf(segment, attachToStartPoint); if (idx != -1) { this.connectedSegments.remove(idx); fireIteratorUpdate(); } return idx; }
[ "int", "removeConnectedSegment", "(", "RoadSegment", "segment", ",", "boolean", "attachToStartPoint", ")", "{", "if", "(", "segment", "==", "null", ")", "{", "return", "-", "1", ";", "}", "final", "int", "idx", "=", "indexOf", "(", "segment", ",", "attachT...
Remove a connection with a segment. @param segment is the segment to remove. @param attachToStartPoint indicates if the segment is attached by its start point (if value is <code>true</code>) or by its end point @return the index of the removed segment, or {@code -1} if none was found
[ "Remove", "a", "connection", "with", "a", "segment", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisroad/src/main/java/org/arakhne/afc/gis/road/StandardRoadConnection.java#L414-L424
spring-projects/spring-boot
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthStatusHttpMapper.java
HealthStatusHttpMapper.addStatusMapping
public void addStatusMapping(Map<String, Integer> statusMapping) { """ Add specific status mappings to the existing set. @param statusMapping a map of health status code to HTTP status code """ Assert.notNull(statusMapping, "StatusMapping must not be null"); this.statusMapping.putAll(statusMapping); }
java
public void addStatusMapping(Map<String, Integer> statusMapping) { Assert.notNull(statusMapping, "StatusMapping must not be null"); this.statusMapping.putAll(statusMapping); }
[ "public", "void", "addStatusMapping", "(", "Map", "<", "String", ",", "Integer", ">", "statusMapping", ")", "{", "Assert", ".", "notNull", "(", "statusMapping", ",", "\"StatusMapping must not be null\"", ")", ";", "this", ".", "statusMapping", ".", "putAll", "("...
Add specific status mappings to the existing set. @param statusMapping a map of health status code to HTTP status code
[ "Add", "specific", "status", "mappings", "to", "the", "existing", "set", "." ]
train
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthStatusHttpMapper.java#L62-L65
Erudika/para
para-server/src/main/java/com/erudika/para/security/filters/TwitterAuthFilter.java
TwitterAuthFilter.attemptAuthentication
@Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws IOException { """ Handles an authentication request. @param request HTTP request @param response HTTP response @return an authentication object that contains the principal object if success...
java
@Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws IOException { final String requestURI = request.getRequestURI(); UserAuthentication userAuth = null; if (requestURI.endsWith(TWITTER_ACTION)) { String verifier = request.getParameter("oau...
[ "@", "Override", "public", "Authentication", "attemptAuthentication", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ")", "throws", "IOException", "{", "final", "String", "requestURI", "=", "request", ".", "getRequestURI", "(", ")", ";",...
Handles an authentication request. @param request HTTP request @param response HTTP response @return an authentication object that contains the principal object if successful. @throws IOException ex
[ "Handles", "an", "authentication", "request", "." ]
train
https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-server/src/main/java/com/erudika/para/security/filters/TwitterAuthFilter.java#L99-L124