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
gresrun/jesque
src/main/java/net/greghaines/jesque/utils/JesqueUtils.java
JesqueUtils.nullSafeEquals
public static boolean nullSafeEquals(final Object obj1, final Object obj2) { """ Test for equality. @param obj1 the first object @param obj2 the second object @return true if both are null or the two objects are equal """ return ((obj1 == null && obj2 == null) || (obj1 != null && obj...
java
public static boolean nullSafeEquals(final Object obj1, final Object obj2) { return ((obj1 == null && obj2 == null) || (obj1 != null && obj2 != null && obj1.equals(obj2))); }
[ "public", "static", "boolean", "nullSafeEquals", "(", "final", "Object", "obj1", ",", "final", "Object", "obj2", ")", "{", "return", "(", "(", "obj1", "==", "null", "&&", "obj2", "==", "null", ")", "||", "(", "obj1", "!=", "null", "&&", "obj2", "!=", ...
Test for equality. @param obj1 the first object @param obj2 the second object @return true if both are null or the two objects are equal
[ "Test", "for", "equality", "." ]
train
https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/utils/JesqueUtils.java#L363-L366
nextreports/nextreports-server
src/ro/nextreports/server/util/StringUtil.java
StringUtil.replaceString
public static ReplacedString replaceString(String s, String find, String replace) { """ Replace a string with another @param s string to replace into @param find string to be replaced @param replace new string @return the string with replacements """ if (replace == null) replace = "-"; ...
java
public static ReplacedString replaceString(String s, String find, String replace) { if (replace == null) replace = "-"; int index = -1; int l = find.length(); boolean replaced = false; do { index = s.indexOf(find, index); if (index >= 0) { ...
[ "public", "static", "ReplacedString", "replaceString", "(", "String", "s", ",", "String", "find", ",", "String", "replace", ")", "{", "if", "(", "replace", "==", "null", ")", "replace", "=", "\"-\"", ";", "int", "index", "=", "-", "1", ";", "int", "l",...
Replace a string with another @param s string to replace into @param find string to be replaced @param replace new string @return the string with replacements
[ "Replace", "a", "string", "with", "another" ]
train
https://github.com/nextreports/nextreports-server/blob/cfce12f5c6d52cb6a739388d50142c6e2e07c55e/src/ro/nextreports/server/util/StringUtil.java#L40-L53
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/ChecksumFileSystem.java
ChecksumFileSystem.copyToLocalFile
public void copyToLocalFile(Path src, Path dst, boolean copyCrc) throws IOException { """ The src file is under FS, and the dst is on the local disk. Copy it from FS control to the local dst name. If src and dst are directories, the copyCrc parameter determines whether to copy CRC files. """ if (!fs...
java
public void copyToLocalFile(Path src, Path dst, boolean copyCrc) throws IOException { if (!fs.isDirectory(src)) { // source is a file fs.copyToLocalFile(src, dst); FileSystem localFs = getLocal(getConf()).getRawFileSystem(); if (localFs.isDirectory(dst)) { dst = new Path(dst, src.getNa...
[ "public", "void", "copyToLocalFile", "(", "Path", "src", ",", "Path", "dst", ",", "boolean", "copyCrc", ")", "throws", "IOException", "{", "if", "(", "!", "fs", ".", "isDirectory", "(", "src", ")", ")", "{", "// source is a file", "fs", ".", "copyToLocalFi...
The src file is under FS, and the dst is on the local disk. Copy it from FS control to the local dst name. If src and dst are directories, the copyCrc parameter determines whether to copy CRC files.
[ "The", "src", "file", "is", "under", "FS", "and", "the", "dst", "is", "on", "the", "local", "disk", ".", "Copy", "it", "from", "FS", "control", "to", "the", "local", "dst", "name", ".", "If", "src", "and", "dst", "are", "directories", "the", "copyCrc...
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/ChecksumFileSystem.java#L547-L570
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/string/StringHelper.java
StringHelper.getTrailingCharCount
@Nonnegative public static int getTrailingCharCount (@Nullable final String s, final char c) { """ Get the number of specified chars, the passed string ends with. @param s The string to be parsed. May be <code>null</code>. @param c The char to be searched. @return Always &ge; 0. """ int ret = 0; ...
java
@Nonnegative public static int getTrailingCharCount (@Nullable final String s, final char c) { int ret = 0; if (s != null) { int nLast = s.length () - 1; while (nLast >= 0 && s.charAt (nLast) == c) { ++ret; --nLast; } } return ret; }
[ "@", "Nonnegative", "public", "static", "int", "getTrailingCharCount", "(", "@", "Nullable", "final", "String", "s", ",", "final", "char", "c", ")", "{", "int", "ret", "=", "0", ";", "if", "(", "s", "!=", "null", ")", "{", "int", "nLast", "=", "s", ...
Get the number of specified chars, the passed string ends with. @param s The string to be parsed. May be <code>null</code>. @param c The char to be searched. @return Always &ge; 0.
[ "Get", "the", "number", "of", "specified", "chars", "the", "passed", "string", "ends", "with", "." ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L861-L875
jnidzwetzki/bitfinex-v2-wss-api-java
src/main/java/com/github/jnidzwetzki/bitfinex/v2/symbol/BitfinexSymbols.java
BitfinexSymbols.candlesticks
public static BitfinexCandlestickSymbol candlesticks(final String currency, final String profitCurrency, final BitfinexCandleTimeFrame timeframe) { """ Returns symbol for candlestick channel @param currency of candles @param profitCurrency of candles @param timeframe configuration of candles...
java
public static BitfinexCandlestickSymbol candlesticks(final String currency, final String profitCurrency, final BitfinexCandleTimeFrame timeframe) { final String currencyNonNull = Objects.requireNonNull(currency).toUpperCase(); final String profitCurrencyNonNull = Objects.requireNonNull(prof...
[ "public", "static", "BitfinexCandlestickSymbol", "candlesticks", "(", "final", "String", "currency", ",", "final", "String", "profitCurrency", ",", "final", "BitfinexCandleTimeFrame", "timeframe", ")", "{", "final", "String", "currencyNonNull", "=", "Objects", ".", "r...
Returns symbol for candlestick channel @param currency of candles @param profitCurrency of candles @param timeframe configuration of candles @return symbol
[ "Returns", "symbol", "for", "candlestick", "channel" ]
train
https://github.com/jnidzwetzki/bitfinex-v2-wss-api-java/blob/2e6adf1eb6f8cd4c8722f1619f78ab2cc3c600ee/src/main/java/com/github/jnidzwetzki/bitfinex/v2/symbol/BitfinexSymbols.java#L66-L73
liferay/com-liferay-commerce
commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceCountryPersistenceImpl.java
CommerceCountryPersistenceImpl.removeByUuid_C
@Override public void removeByUuid_C(String uuid, long companyId) { """ Removes all the commerce countries where uuid = &#63; and companyId = &#63; from the database. @param uuid the uuid @param companyId the company ID """ for (CommerceCountry commerceCountry : findByUuid_C(uuid, companyId, QueryUt...
java
@Override public void removeByUuid_C(String uuid, long companyId) { for (CommerceCountry commerceCountry : findByUuid_C(uuid, companyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(commerceCountry); } }
[ "@", "Override", "public", "void", "removeByUuid_C", "(", "String", "uuid", ",", "long", "companyId", ")", "{", "for", "(", "CommerceCountry", "commerceCountry", ":", "findByUuid_C", "(", "uuid", ",", "companyId", ",", "QueryUtil", ".", "ALL_POS", ",", "QueryU...
Removes all the commerce countries where uuid = &#63; and companyId = &#63; from the database. @param uuid the uuid @param companyId the company ID
[ "Removes", "all", "the", "commerce", "countries", "where", "uuid", "=", "&#63", ";", "and", "companyId", "=", "&#63", ";", "from", "the", "database", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceCountryPersistenceImpl.java#L1402-L1408
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/PredictionsImpl.java
PredictionsImpl.predictImageUrlWithServiceResponseAsync
public Observable<ServiceResponse<ImagePrediction>> predictImageUrlWithServiceResponseAsync(UUID projectId, PredictImageUrlOptionalParameter predictImageUrlOptionalParameter) { """ Predict an image url and saves the result. @param projectId The project id @param predictImageUrlOptionalParameter the object repr...
java
public Observable<ServiceResponse<ImagePrediction>> predictImageUrlWithServiceResponseAsync(UUID projectId, PredictImageUrlOptionalParameter predictImageUrlOptionalParameter) { if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); ...
[ "public", "Observable", "<", "ServiceResponse", "<", "ImagePrediction", ">", ">", "predictImageUrlWithServiceResponseAsync", "(", "UUID", "projectId", ",", "PredictImageUrlOptionalParameter", "predictImageUrlOptionalParameter", ")", "{", "if", "(", "projectId", "==", "null"...
Predict an image url and saves the result. @param projectId The project id @param predictImageUrlOptionalParameter the object representing the optional parameters to be set before calling this API @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the ImagePrediction ob...
[ "Predict", "an", "image", "url", "and", "saves", "the", "result", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/PredictionsImpl.java#L667-L679
alibaba/jstorm
jstorm-core/src/main/java/storm/trident/Stream.java
Stream.slidingWindow
public Stream slidingWindow(int windowCount, int slideCount, WindowsStoreFactory windowStoreFactory, Fields inputFields, Aggregator aggregator, Fields functionFields) { """ Returns a stream of tuples which are aggregated results of a sliding window with every {@code windowCount...
java
public Stream slidingWindow(int windowCount, int slideCount, WindowsStoreFactory windowStoreFactory, Fields inputFields, Aggregator aggregator, Fields functionFields) { return window(SlidingCountWindow.of(windowCount, slideCount), windowStoreFactory, inputFields, aggregator,...
[ "public", "Stream", "slidingWindow", "(", "int", "windowCount", ",", "int", "slideCount", ",", "WindowsStoreFactory", "windowStoreFactory", ",", "Fields", "inputFields", ",", "Aggregator", "aggregator", ",", "Fields", "functionFields", ")", "{", "return", "window", ...
Returns a stream of tuples which are aggregated results of a sliding window with every {@code windowCount} of tuples and slides the window after {@code slideCount}. @param windowCount represents tuples count of a window @param inputFields projected fields for aggregator @param aggregator aggregator to run on the windo...
[ "Returns", "a", "stream", "of", "tuples", "which", "are", "aggregated", "results", "of", "a", "sliding", "window", "with", "every", "{", "@code", "windowCount", "}", "of", "tuples", "and", "slides", "the", "window", "after", "{", "@code", "slideCount", "}", ...
train
https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/storm/trident/Stream.java#L621-L624
alkacon/opencms-core
src-gwt/org/opencms/ade/galleries/client/preview/ui/CmsImageFormatsForm.java
CmsImageFormatsForm.setRatioButton
public void setRatioButton(boolean down, boolean enabled, String disableMessage) { """ Sets the state of the ratio lock button.<p> @param down if <code>true</code> button will be set down / lock open @param enabled if <code>true</code> button will be enabled @param disableMessage message to show for disabled ...
java
public void setRatioButton(boolean down, boolean enabled, String disableMessage) { m_ratioLock.setDown(down); if (enabled) { m_ratioLock.enable(); } else { m_ratioLock.disable(disableMessage); } }
[ "public", "void", "setRatioButton", "(", "boolean", "down", ",", "boolean", "enabled", ",", "String", "disableMessage", ")", "{", "m_ratioLock", ".", "setDown", "(", "down", ")", ";", "if", "(", "enabled", ")", "{", "m_ratioLock", ".", "enable", "(", ")", ...
Sets the state of the ratio lock button.<p> @param down if <code>true</code> button will be set down / lock open @param enabled if <code>true</code> button will be enabled @param disableMessage message to show for disabled button
[ "Sets", "the", "state", "of", "the", "ratio", "lock", "button", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/preview/ui/CmsImageFormatsForm.java#L359-L367
languagetool-org/languagetool
languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/AgreementRule.java
AgreementRule.getPosAfterModifier
private int getPosAfterModifier(int startAt, AnalyzedTokenReadings[] tokens) { """ Search for modifiers (such as "sehr", "1,4 Meter") which can expand a determiner - adjective - noun group ("ein hohes Haus" -> "ein sehr hohes Haus", "ein 500 Meter hohes Haus") and return the index of the first non-modifier token...
java
private int getPosAfterModifier(int startAt, AnalyzedTokenReadings[] tokens) { if ((startAt + 1) < tokens.length && MODIFIERS.contains(tokens[startAt].getToken())) { startAt++; } if ((startAt + 1) < tokens.length && (StringUtils.isNumeric(tokens[startAt].getToken()) || tokens[startAt].hasPosTag("ZAL")...
[ "private", "int", "getPosAfterModifier", "(", "int", "startAt", ",", "AnalyzedTokenReadings", "[", "]", "tokens", ")", "{", "if", "(", "(", "startAt", "+", "1", ")", "<", "tokens", ".", "length", "&&", "MODIFIERS", ".", "contains", "(", "tokens", "[", "s...
Search for modifiers (such as "sehr", "1,4 Meter") which can expand a determiner - adjective - noun group ("ein hohes Haus" -> "ein sehr hohes Haus", "ein 500 Meter hohes Haus") and return the index of the first non-modifier token ("Haus") @param startAt index of array where to start searching for modifier @return inde...
[ "Search", "for", "modifiers", "(", "such", "as", "sehr", "1", "4", "Meter", ")", "which", "can", "expand", "a", "determiner", "-", "adjective", "-", "noun", "group", "(", "ein", "hohes", "Haus", "-", ">", "ein", "sehr", "hohes", "Haus", "ein", "500", ...
train
https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/AgreementRule.java#L575-L589
apereo/person-directory
person-directory-impl/src/main/java/org/apereo/services/persondir/support/ComplexStubPersonAttributeDao.java
ComplexStubPersonAttributeDao.setBackingMap
public void setBackingMap(final Map<String, Map<String, List<Object>>> backingMap) { """ The backing Map to use for queries, the outer map is keyed on the query attribute. The inner Map is the set of user attributes to be returned for the query attribute. @param backingMap backing map """ if (backi...
java
public void setBackingMap(final Map<String, Map<String, List<Object>>> backingMap) { if (backingMap == null) { this.backingMap = new HashMap<>(); this.possibleUserAttributeNames = new HashSet<>(); } else { this.backingMap = new LinkedHashMap<>(backingMap); ...
[ "public", "void", "setBackingMap", "(", "final", "Map", "<", "String", ",", "Map", "<", "String", ",", "List", "<", "Object", ">", ">", ">", "backingMap", ")", "{", "if", "(", "backingMap", "==", "null", ")", "{", "this", ".", "backingMap", "=", "new...
The backing Map to use for queries, the outer map is keyed on the query attribute. The inner Map is the set of user attributes to be returned for the query attribute. @param backingMap backing map
[ "The", "backing", "Map", "to", "use", "for", "queries", "the", "outer", "map", "is", "keyed", "on", "the", "query", "attribute", ".", "The", "inner", "Map", "is", "the", "set", "of", "user", "attributes", "to", "be", "returned", "for", "the", "query", ...
train
https://github.com/apereo/person-directory/blob/331200c0878aec202b8aff12a732402d6ba7681f/person-directory-impl/src/main/java/org/apereo/services/persondir/support/ComplexStubPersonAttributeDao.java#L124-L132
gallandarakhneorg/afc
advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusItinerary.java
BusItinerary.addBusHalt
public BusItineraryHalt addBusHalt(UUID id, String name, BusItineraryHaltType type) { """ Add a bus halt inside the bus itinerary. <p>The insertion index is computed automatically @param id is the identifier of the bus halt. @param name is the name of the bus halt @param type is the type of the bus halt. ...
java
public BusItineraryHalt addBusHalt(UUID id, String name, BusItineraryHaltType type) { return this.addBusHalt(id, name, type, -1); }
[ "public", "BusItineraryHalt", "addBusHalt", "(", "UUID", "id", ",", "String", "name", ",", "BusItineraryHaltType", "type", ")", "{", "return", "this", ".", "addBusHalt", "(", "id", ",", "name", ",", "type", ",", "-", "1", ")", ";", "}" ]
Add a bus halt inside the bus itinerary. <p>The insertion index is computed automatically @param id is the identifier of the bus halt. @param name is the name of the bus halt @param type is the type of the bus halt. @return the added bus halt, otherwise <code>null</code>
[ "Add", "a", "bus", "halt", "inside", "the", "bus", "itinerary", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusItinerary.java#L1077-L1079
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/alert/notifier/AuditNotifier.java
AuditNotifier.getMetricUrl
protected String getMetricUrl(String metricToAnnotate, long triggerFiredTime) { """ Returns the URL linking back to the metric for use in alert notification. @param metricToAnnotate The metric to annotate. @param triggerFiredTime The epoch timestamp when the corresponding trigger fired. @return The f...
java
protected String getMetricUrl(String metricToAnnotate, long triggerFiredTime) { long start = triggerFiredTime - (6L * DateTimeConstants.MILLIS_PER_HOUR); long end = Math.min(System.currentTimeMillis(), triggerFiredTime + (6L * DateTimeConstants.MILLIS_PER_HOUR)); String expression = MessageFormat.format("{0,numbe...
[ "protected", "String", "getMetricUrl", "(", "String", "metricToAnnotate", ",", "long", "triggerFiredTime", ")", "{", "long", "start", "=", "triggerFiredTime", "-", "(", "6L", "*", "DateTimeConstants", ".", "MILLIS_PER_HOUR", ")", ";", "long", "end", "=", "Math",...
Returns the URL linking back to the metric for use in alert notification. @param metricToAnnotate The metric to annotate. @param triggerFiredTime The epoch timestamp when the corresponding trigger fired. @return The fully constructed URL for the metric.
[ "Returns", "the", "URL", "linking", "back", "to", "the", "metric", "for", "use", "in", "alert", "notification", "." ]
train
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/alert/notifier/AuditNotifier.java#L217-L222
elki-project/elki
elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/transform/FastMultidimensionalScalingTransform.java
FastMultidimensionalScalingTransform.updateMatrix
protected void updateMatrix(double[][] mat, final double[] evec, double eval) { """ Update matrix, by removing the effects of a known Eigenvector. @param mat Matrix @param evec Known normalized Eigenvector @param eval Eigenvalue """ final int size = mat.length; for(int i = 0; i < size; i++) { ...
java
protected void updateMatrix(double[][] mat, final double[] evec, double eval) { final int size = mat.length; for(int i = 0; i < size; i++) { final double[] mati = mat[i]; final double eveci = evec[i]; for(int j = 0; j < size; j++) { mati[j] -= eval * eveci * evec[j]; } } }
[ "protected", "void", "updateMatrix", "(", "double", "[", "]", "[", "]", "mat", ",", "final", "double", "[", "]", "evec", ",", "double", "eval", ")", "{", "final", "int", "size", "=", "mat", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";...
Update matrix, by removing the effects of a known Eigenvector. @param mat Matrix @param evec Known normalized Eigenvector @param eval Eigenvalue
[ "Update", "matrix", "by", "removing", "the", "effects", "of", "a", "known", "Eigenvector", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/transform/FastMultidimensionalScalingTransform.java#L304-L313
jeremybrooks/jinx
src/main/java/net/jeremybrooks/jinx/api/PhotosApi.java
PhotosApi.getCounts
public Photocounts getCounts(List<Date> dates, List<Date> takenDates) throws JinxException { """ Gets a list of photo counts for the given date ranges for the calling user. <br> This method requires authentication with 'read' permission. <br> You must provide either dates or takenDates parameters. Flickr may n...
java
public Photocounts getCounts(List<Date> dates, List<Date> takenDates) throws JinxException { Map<String, String> params = new TreeMap<>(); params.put("method", "flickr.photos.getCounts"); if (!JinxUtils.isNullOrEmpty(dates)) { Collections.sort(dates); List<String> formattedDates = new ArrayList<...
[ "public", "Photocounts", "getCounts", "(", "List", "<", "Date", ">", "dates", ",", "List", "<", "Date", ">", "takenDates", ")", "throws", "JinxException", "{", "Map", "<", "String", ",", "String", ">", "params", "=", "new", "TreeMap", "<>", "(", ")", "...
Gets a list of photo counts for the given date ranges for the calling user. <br> This method requires authentication with 'read' permission. <br> You must provide either dates or takenDates parameters. Flickr may not return correct results if you specify both. @param dates a list of dates denoting the periods to ...
[ "Gets", "a", "list", "of", "photo", "counts", "for", "the", "given", "date", "ranges", "for", "the", "calling", "user", ".", "<br", ">", "This", "method", "requires", "authentication", "with", "read", "permission", ".", "<br", ">", "You", "must", "provide"...
train
https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/PhotosApi.java#L246-L265
kmi/iserve
iserve-sal-core/src/main/java/uk/ac/open/kmi/iserve/sal/manager/impl/ServiceManagerSparql.java
ServiceManagerSparql.listEntitiesByDataModel
private Set<URI> listEntitiesByDataModel(com.hp.hpl.jena.rdf.model.Resource entityType, Property dataPropertyType, URI modelReference) { """ Given the URI of a type (i.e., a modelReference), this method figures out all the entities of a type (Service or Operation are the ones that are expected) that have this as ...
java
private Set<URI> listEntitiesByDataModel(com.hp.hpl.jena.rdf.model.Resource entityType, Property dataPropertyType, URI modelReference) { if (modelReference == null) { return ImmutableSet.of(); } StringBuilder queryBuilder = new StringBuilder() .append("SELECT DISTIN...
[ "private", "Set", "<", "URI", ">", "listEntitiesByDataModel", "(", "com", ".", "hp", ".", "hpl", ".", "jena", ".", "rdf", ".", "model", ".", "Resource", "entityType", ",", "Property", "dataPropertyType", ",", "URI", "modelReference", ")", "{", "if", "(", ...
Given the URI of a type (i.e., a modelReference), this method figures out all the entities of a type (Service or Operation are the ones that are expected) that have this as part of their inputs or outputs. What data relationship should be used is also parameterised. @param entityType the type of entity we are lo...
[ "Given", "the", "URI", "of", "a", "type", "(", "i", ".", "e", ".", "a", "modelReference", ")", "this", "method", "figures", "out", "all", "the", "entities", "of", "a", "type", "(", "Service", "or", "Operation", "are", "the", "ones", "that", "are", "e...
train
https://github.com/kmi/iserve/blob/13e7016e64c1d5a539b838c6debf1a5cc4aefcb7/iserve-sal-core/src/main/java/uk/ac/open/kmi/iserve/sal/manager/impl/ServiceManagerSparql.java#L831-L873
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/security/CredentialReference.java
CredentialReference.getAttributeBuilder
public static ObjectTypeAttributeDefinition.Builder getAttributeBuilder(boolean allowNull, boolean referenceCredentialStore) { """ Gets an attribute builder for a credential-reference attribute with the standard {@code credential-reference} attribute name, a configurable setting as to whether the attribute is req...
java
public static ObjectTypeAttributeDefinition.Builder getAttributeBuilder(boolean allowNull, boolean referenceCredentialStore) { AttributeDefinition csAttr = referenceCredentialStore ? credentialStoreAttributeWithCapabilityReference : credentialStoreAttribute; return getAttributeBuilder(CREDENTIAL_REFEREN...
[ "public", "static", "ObjectTypeAttributeDefinition", ".", "Builder", "getAttributeBuilder", "(", "boolean", "allowNull", ",", "boolean", "referenceCredentialStore", ")", "{", "AttributeDefinition", "csAttr", "=", "referenceCredentialStore", "?", "credentialStoreAttributeWithCap...
Gets an attribute builder for a credential-reference attribute with the standard {@code credential-reference} attribute name, a configurable setting as to whether the attribute is required, and optionally configured to {@link org.jboss.as.controller.AbstractAttributeDefinitionBuilder#setCapabilityReference(String) regi...
[ "Gets", "an", "attribute", "builder", "for", "a", "credential", "-", "reference", "attribute", "with", "the", "standard", "{", "@code", "credential", "-", "reference", "}", "attribute", "name", "a", "configurable", "setting", "as", "to", "whether", "the", "att...
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/security/CredentialReference.java#L186-L189
qiniu/java-sdk
src/main/java/com/qiniu/streaming/StreamingManager.java
StreamingManager.saveAs
public String saveAs(String streamKey, String fileName, long start, long end, StringMap other) throws QiniuException { """ * 从直播流数据中录制点播,该方法可以指定录制的时间段 @param streamKey 流名称 @param fileName 录制后保存的文件名 @param start 录制开始的时间戳,单位秒 @param end 录制结束的时间戳,单位秒 @param other 文档中指定的其它参数 """ ...
java
public String saveAs(String streamKey, String fileName, long start, long end, StringMap other) throws QiniuException { String path = encodeKey(streamKey) + "/saveas"; StringMap param = other != null ? other : new StringMap(); param.putNotEmpty("fname", fileName).put("start", start).p...
[ "public", "String", "saveAs", "(", "String", "streamKey", ",", "String", "fileName", ",", "long", "start", ",", "long", "end", ",", "StringMap", "other", ")", "throws", "QiniuException", "{", "String", "path", "=", "encodeKey", "(", "streamKey", ")", "+", ...
* 从直播流数据中录制点播,该方法可以指定录制的时间段 @param streamKey 流名称 @param fileName 录制后保存的文件名 @param start 录制开始的时间戳,单位秒 @param end 录制结束的时间戳,单位秒 @param other 文档中指定的其它参数
[ "*", "从直播流数据中录制点播,该方法可以指定录制的时间段" ]
train
https://github.com/qiniu/java-sdk/blob/6c05f3fb718403a496c725b048e9241f80171499/src/main/java/com/qiniu/streaming/StreamingManager.java#L167-L175
JodaOrg/joda-time
src/main/java/org/joda/time/Period.java
Period.plusSeconds
public Period plusSeconds(int seconds) { """ Returns a new period plus the specified number of seconds added. <p> This period instance is immutable and unaffected by this method call. @param seconds the amount of seconds to add, may be negative @return the new period plus the increased seconds @throws Unsu...
java
public Period plusSeconds(int seconds) { if (seconds == 0) { return this; } int[] values = getValues(); // cloned getPeriodType().addIndexedField(this, PeriodType.SECOND_INDEX, values, seconds); return new Period(values, getPeriodType()); }
[ "public", "Period", "plusSeconds", "(", "int", "seconds", ")", "{", "if", "(", "seconds", "==", "0", ")", "{", "return", "this", ";", "}", "int", "[", "]", "values", "=", "getValues", "(", ")", ";", "// cloned", "getPeriodType", "(", ")", ".", "addIn...
Returns a new period plus the specified number of seconds added. <p> This period instance is immutable and unaffected by this method call. @param seconds the amount of seconds to add, may be negative @return the new period plus the increased seconds @throws UnsupportedOperationException if the field is not supported
[ "Returns", "a", "new", "period", "plus", "the", "specified", "number", "of", "seconds", "added", ".", "<p", ">", "This", "period", "instance", "is", "immutable", "and", "unaffected", "by", "this", "method", "call", "." ]
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Period.java#L1177-L1184
Waikato/moa
moa/src/main/java/moa/clusterers/clustree/Entry.java
Entry.makeOlder
protected void makeOlder(long currentTime, double negLambda) { """ Ages this entrie's data AND buffer according to the given time and aging constant. @param currentTime the current time @param negLambda the aging constant """ // assert (currentTime > this.timestamp) : "currentTime : " // ...
java
protected void makeOlder(long currentTime, double negLambda) { // assert (currentTime > this.timestamp) : "currentTime : " // + currentTime + ", this.timestamp: " + this.timestamp; long diff = currentTime - this.timestamp; this.buffer.makeOlder(diff, negLambda); this.data....
[ "protected", "void", "makeOlder", "(", "long", "currentTime", ",", "double", "negLambda", ")", "{", "// assert (currentTime > this.timestamp) : \"currentTime : \"", "// + currentTime + \", this.timestamp: \" + this.timestamp;", "long", "diff", "=", "currentTime"...
Ages this entrie's data AND buffer according to the given time and aging constant. @param currentTime the current time @param negLambda the aging constant
[ "Ages", "this", "entrie", "s", "data", "AND", "buffer", "according", "to", "the", "given", "time", "and", "aging", "constant", "." ]
train
https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/clusterers/clustree/Entry.java#L454-L462
sarxos/webcam-capture
webcam-capture-drivers/driver-raspberrypi/src/main/java/com/github/sarxos/webcam/ds/raspberrypi/IPCDriver.java
IPCDriver.parseArguments
protected void parseArguments(final Options options, String[] cmdArray) { """ parse arguments and add to arguments @param options @param cmdArray """ CommandLineParser parser = new PosixParser(); try { CommandLine cmd = parser.parse(options, cmdArray); Option[] opts = cmd.getOptions(); for (Op...
java
protected void parseArguments(final Options options, String[] cmdArray) { CommandLineParser parser = new PosixParser(); try { CommandLine cmd = parser.parse(options, cmdArray); Option[] opts = cmd.getOptions(); for (Option o : opts) { arguments.put(o.getLongOpt(), o.getValue() == null ? "" : o.getValue...
[ "protected", "void", "parseArguments", "(", "final", "Options", "options", ",", "String", "[", "]", "cmdArray", ")", "{", "CommandLineParser", "parser", "=", "new", "PosixParser", "(", ")", ";", "try", "{", "CommandLine", "cmd", "=", "parser", ".", "parse", ...
parse arguments and add to arguments @param options @param cmdArray
[ "parse", "arguments", "and", "add", "to", "arguments" ]
train
https://github.com/sarxos/webcam-capture/blob/efbdae04f9ba48db9ec621e94a9bcd6f031882c8/webcam-capture-drivers/driver-raspberrypi/src/main/java/com/github/sarxos/webcam/ds/raspberrypi/IPCDriver.java#L90-L104
youseries/urule
urule-console/src/main/java/com/bstek/urule/console/repository/database/journal/DatabaseJournal.java
DatabaseJournal.createCheckSchemaOperation
protected CheckSchemaOperation createCheckSchemaOperation() { """ This method is called from {@link #init(String, NamespaceResolver)} after the {@link #createConnectionHelper(DataSource)} method, and returns a default {@link CheckSchemaOperation}. Subclasses can overrride this implementation to get a customized ...
java
protected CheckSchemaOperation createCheckSchemaOperation() { InputStream in = org.apache.jackrabbit.core.journal.DatabaseJournal.class.getResourceAsStream(databaseType + ".ddl"); return new CheckSchemaOperation(conHelper, in, schemaObjectPrefix + DEFAULT_JOURNAL_TABLE).addVariableReplacement( ...
[ "protected", "CheckSchemaOperation", "createCheckSchemaOperation", "(", ")", "{", "InputStream", "in", "=", "org", ".", "apache", ".", "jackrabbit", ".", "core", ".", "journal", ".", "DatabaseJournal", ".", "class", ".", "getResourceAsStream", "(", "databaseType", ...
This method is called from {@link #init(String, NamespaceResolver)} after the {@link #createConnectionHelper(DataSource)} method, and returns a default {@link CheckSchemaOperation}. Subclasses can overrride this implementation to get a customized implementation. @return a new {@link CheckSchemaOperation} instance
[ "This", "method", "is", "called", "from", "{", "@link", "#init", "(", "String", "NamespaceResolver", ")", "}", "after", "the", "{", "@link", "#createConnectionHelper", "(", "DataSource", ")", "}", "method", "and", "returns", "a", "default", "{", "@link", "Ch...
train
https://github.com/youseries/urule/blob/3fa0eb4439e97aa292e744bcbd88a9faa36661d8/urule-console/src/main/java/com/bstek/urule/console/repository/database/journal/DatabaseJournal.java#L283-L287
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/optimization/QNMinimizer.java
QNMinimizer.computeDir
private void computeDir(double[] dir, double[] fg, QNInfo qn) throws SurpriseConvergence { """ /* computeDir() This function will calculate an approximation of the inverse hessian based off the seen s,y vector pairs. This particular approximation uses the BFGS update. """ System.arraycopy(fg,...
java
private void computeDir(double[] dir, double[] fg, QNInfo qn) throws SurpriseConvergence { System.arraycopy(fg, 0, dir, 0, fg.length); int mmm = qn.size(); double[] as = new double[mmm]; for (int i = mmm - 1; i >= 0; i--) { as[i] = qn.getRho(i) * ArrayMath.innerProduct(qn.getS(i), ...
[ "private", "void", "computeDir", "(", "double", "[", "]", "dir", ",", "double", "[", "]", "fg", ",", "QNInfo", "qn", ")", "throws", "SurpriseConvergence", "{", "System", ".", "arraycopy", "(", "fg", ",", "0", ",", "dir", ",", "0", ",", "fg", ".", "...
/* computeDir() This function will calculate an approximation of the inverse hessian based off the seen s,y vector pairs. This particular approximation uses the BFGS update.
[ "/", "*", "computeDir", "()" ]
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/optimization/QNMinimizer.java#L771-L792
ops4j/org.ops4j.pax.exam2
core/pax-exam-spi/src/main/java/org/ops4j/pax/exam/spi/war/FileFinder.java
FileFinder.findFile
public static File findFile(File rootDir, FilenameFilter filter) { """ Finds a file matching the given file name filter in the given root directory or any subdirectory. The files and directories are scanned in alphabetical order, so the result is deterministic. <p> The method returns the first matching result,...
java
public static File findFile(File rootDir, FilenameFilter filter) { File[] files = rootDir.listFiles(filter); Arrays.sort(files); if (files.length > 0) { return files[0]; } files = rootDir.listFiles(directoryFilter); Arrays.sort(files); for (File subDi...
[ "public", "static", "File", "findFile", "(", "File", "rootDir", ",", "FilenameFilter", "filter", ")", "{", "File", "[", "]", "files", "=", "rootDir", ".", "listFiles", "(", "filter", ")", ";", "Arrays", ".", "sort", "(", "files", ")", ";", "if", "(", ...
Finds a file matching the given file name filter in the given root directory or any subdirectory. The files and directories are scanned in alphabetical order, so the result is deterministic. <p> The method returns the first matching result, if any, and ignores all other matches. @param rootDir root directory @param fi...
[ "Finds", "a", "file", "matching", "the", "given", "file", "name", "filter", "in", "the", "given", "root", "directory", "or", "any", "subdirectory", ".", "The", "files", "and", "directories", "are", "scanned", "in", "alphabetical", "order", "so", "the", "resu...
train
https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/core/pax-exam-spi/src/main/java/org/ops4j/pax/exam/spi/war/FileFinder.java#L86-L102
biojava/biojava
biojava-aa-prop/src/main/java/org/biojava/nbio/aaproperties/Utils.java
Utils.checkSequence
public static final String checkSequence(String sequence, Set<Character> cSet) { """ Checks if the sequence contains invalid characters. Note that any character outside of the 20 standard protein amino acid codes are considered as invalid. If yes, it will return a new sequence where invalid characters are replac...
java
public static final String checkSequence(String sequence, Set<Character> cSet){ boolean containInvalid = false; if(cSet != null){ containInvalid = sequence != null && doesSequenceContainInvalidChar(sequence, cSet); }else{ containInvalid = sequence != null && doesSequenceContainInvalidChar(sequence, PeptideP...
[ "public", "static", "final", "String", "checkSequence", "(", "String", "sequence", ",", "Set", "<", "Character", ">", "cSet", ")", "{", "boolean", "containInvalid", "=", "false", ";", "if", "(", "cSet", "!=", "null", ")", "{", "containInvalid", "=", "seque...
Checks if the sequence contains invalid characters. Note that any character outside of the 20 standard protein amino acid codes are considered as invalid. If yes, it will return a new sequence where invalid characters are replaced with '-'. If no, it will simply return the input sequence. @param sequence protein seque...
[ "Checks", "if", "the", "sequence", "contains", "invalid", "characters", ".", "Note", "that", "any", "character", "outside", "of", "the", "20", "standard", "protein", "amino", "acid", "codes", "are", "considered", "as", "invalid", ".", "If", "yes", "it", "wil...
train
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-aa-prop/src/main/java/org/biojava/nbio/aaproperties/Utils.java#L165-L182
michel-kraemer/bson4jackson
src/main/java/de/undercouch/bson4jackson/BsonParser.java
BsonParser.readObjectId
protected ObjectId readObjectId() throws IOException { """ Reads a ObjectID from the input stream @return the ObjectID @throws IOException if the ObjectID could not be read """ int time = ByteOrderUtil.flip(_in.readInt()); int machine = ByteOrderUtil.flip(_in.readInt()); int inc = ByteOrderUtil.flip(_i...
java
protected ObjectId readObjectId() throws IOException { int time = ByteOrderUtil.flip(_in.readInt()); int machine = ByteOrderUtil.flip(_in.readInt()); int inc = ByteOrderUtil.flip(_in.readInt()); return new ObjectId(time, machine, inc); }
[ "protected", "ObjectId", "readObjectId", "(", ")", "throws", "IOException", "{", "int", "time", "=", "ByteOrderUtil", ".", "flip", "(", "_in", ".", "readInt", "(", ")", ")", ";", "int", "machine", "=", "ByteOrderUtil", ".", "flip", "(", "_in", ".", "read...
Reads a ObjectID from the input stream @return the ObjectID @throws IOException if the ObjectID could not be read
[ "Reads", "a", "ObjectID", "from", "the", "input", "stream" ]
train
https://github.com/michel-kraemer/bson4jackson/blob/32d2ab3c516b3c07490fdfcf0c5e4ed0a2ee3979/src/main/java/de/undercouch/bson4jackson/BsonParser.java#L618-L623
QSFT/Doradus
doradus-server/src/main/java/com/dell/doradus/service/rest/RESTServlet.java
RESTServlet.getTenant
private Tenant getTenant(Map<String, String> variableMap) { """ Get the Tenant context for this command and multi-tenant configuration options. """ String tenantName = variableMap.get("tenant"); if (Utils.isEmpty(tenantName)) { tenantName = TenantService.instance().getDefaultTena...
java
private Tenant getTenant(Map<String, String> variableMap) { String tenantName = variableMap.get("tenant"); if (Utils.isEmpty(tenantName)) { tenantName = TenantService.instance().getDefaultTenantName(); } Tenant tenant = TenantService.instance().getTenant(tenantName); ...
[ "private", "Tenant", "getTenant", "(", "Map", "<", "String", ",", "String", ">", "variableMap", ")", "{", "String", "tenantName", "=", "variableMap", ".", "get", "(", "\"tenant\"", ")", ";", "if", "(", "Utils", ".", "isEmpty", "(", "tenantName", ")", ")"...
Get the Tenant context for this command and multi-tenant configuration options.
[ "Get", "the", "Tenant", "context", "for", "this", "command", "and", "multi", "-", "tenant", "configuration", "options", "." ]
train
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/rest/RESTServlet.java#L214-L224
spring-projects/spring-social-facebook
spring-social-facebook-web/src/main/java/org/springframework/social/facebook/web/CanvasSignInController.java
CanvasSignInController.postDeclineView
protected View postDeclineView() { """ View that redirects the top level window to the URL defined in postDeclineUrl property after user declines to authorize application. May be overridden for custom views, particularly in the case where the post-decline view should be rendered in-canvas. @return a view to disp...
java
protected View postDeclineView() { return new TopLevelWindowRedirect() { @Override protected String getRedirectUrl(Map<String, ?> model) { return postDeclineUrl; } }; }
[ "protected", "View", "postDeclineView", "(", ")", "{", "return", "new", "TopLevelWindowRedirect", "(", ")", "{", "@", "Override", "protected", "String", "getRedirectUrl", "(", "Map", "<", "String", ",", "?", ">", "model", ")", "{", "return", "postDeclineUrl", ...
View that redirects the top level window to the URL defined in postDeclineUrl property after user declines to authorize application. May be overridden for custom views, particularly in the case where the post-decline view should be rendered in-canvas. @return a view to display after a user declines authoriation. Defaul...
[ "View", "that", "redirects", "the", "top", "level", "window", "to", "the", "URL", "defined", "in", "postDeclineUrl", "property", "after", "user", "declines", "to", "authorize", "application", ".", "May", "be", "overridden", "for", "custom", "views", "particularl...
train
https://github.com/spring-projects/spring-social-facebook/blob/ae2234d94367eaa3adbba251ec7790d5ba7ffa41/spring-social-facebook-web/src/main/java/org/springframework/social/facebook/web/CanvasSignInController.java#L165-L172
jroyalty/jglm
src/main/java/com/hackoeur/jglm/support/Precision.java
Precision.equalsIncludingNaN
public static boolean equalsIncludingNaN(double x, double y) { """ Returns true if both arguments are NaN or neither is NaN and they are equal as defined by {@link #equals(double,double) equals(x, y, 1)}. @param x first value @param y second value @return {@code true} if the values are equal or both are NaN....
java
public static boolean equalsIncludingNaN(double x, double y) { return (Double.isNaN(x) && Double.isNaN(y)) || equals(x, y, 1); }
[ "public", "static", "boolean", "equalsIncludingNaN", "(", "double", "x", ",", "double", "y", ")", "{", "return", "(", "Double", ".", "isNaN", "(", "x", ")", "&&", "Double", ".", "isNaN", "(", "y", ")", ")", "||", "equals", "(", "x", ",", "y", ",", ...
Returns true if both arguments are NaN or neither is NaN and they are equal as defined by {@link #equals(double,double) equals(x, y, 1)}. @param x first value @param y second value @return {@code true} if the values are equal or both are NaN. @since 2.2
[ "Returns", "true", "if", "both", "arguments", "are", "NaN", "or", "neither", "is", "NaN", "and", "they", "are", "equal", "as", "defined", "by", "{", "@link", "#equals", "(", "double", "double", ")", "equals", "(", "x", "y", "1", ")", "}", "." ]
train
https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/Precision.java#L252-L254
mapbox/mapbox-java
services-geojson/src/main/java/com/mapbox/geojson/MultiPolygon.java
MultiPolygon.fromPolygon
public static MultiPolygon fromPolygon(@NonNull Polygon polygon, @Nullable BoundingBox bbox) { """ Create a new instance of this class by defining a single {@link Polygon} objects and passing it in as a parameter in this method. The Polygon should comply with the GeoJson specifications described in the documenta...
java
public static MultiPolygon fromPolygon(@NonNull Polygon polygon, @Nullable BoundingBox bbox) { List<List<List<Point>>> coordinates = Arrays.asList(polygon.coordinates()); return new MultiPolygon(TYPE, bbox, coordinates); }
[ "public", "static", "MultiPolygon", "fromPolygon", "(", "@", "NonNull", "Polygon", "polygon", ",", "@", "Nullable", "BoundingBox", "bbox", ")", "{", "List", "<", "List", "<", "List", "<", "Point", ">>>", "coordinates", "=", "Arrays", ".", "asList", "(", "p...
Create a new instance of this class by defining a single {@link Polygon} objects and passing it in as a parameter in this method. The Polygon should comply with the GeoJson specifications described in the documentation. @param polygon a single Polygon which make up this MultiPolygon @param bbox optionally include a...
[ "Create", "a", "new", "instance", "of", "this", "class", "by", "defining", "a", "single", "{", "@link", "Polygon", "}", "objects", "and", "passing", "it", "in", "as", "a", "parameter", "in", "this", "method", ".", "The", "Polygon", "should", "comply", "w...
train
https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-geojson/src/main/java/com/mapbox/geojson/MultiPolygon.java#L164-L167
Sciss/abc4j
abc/src/main/java/abc/ui/swing/ScoreTemplate.java
ScoreTemplate.setElementColor
public void setElementColor(byte scoreElement, Color color) { """ Sets the color of the given element type @param scoreElement One of the {@link ScoreElements} constant @param color <TT>null</TT> to remove this attribute """ String name = "COLOR_"+Byte.toString(scoreElement); if (color == null) m...
java
public void setElementColor(byte scoreElement, Color color) { String name = "COLOR_"+Byte.toString(scoreElement); if (color == null) m_attributes.remove(name); else m_attributes.put(name, color); notifyListeners(); }
[ "public", "void", "setElementColor", "(", "byte", "scoreElement", ",", "Color", "color", ")", "{", "String", "name", "=", "\"COLOR_\"", "+", "Byte", ".", "toString", "(", "scoreElement", ")", ";", "if", "(", "color", "==", "null", ")", "m_attributes", ".",...
Sets the color of the given element type @param scoreElement One of the {@link ScoreElements} constant @param color <TT>null</TT> to remove this attribute
[ "Sets", "the", "color", "of", "the", "given", "element", "type" ]
train
https://github.com/Sciss/abc4j/blob/117b405642c84a7bfca4e3e13668838258b90ca7/abc/src/main/java/abc/ui/swing/ScoreTemplate.java#L782-L789
threerings/nenya
core/src/main/java/com/threerings/media/tile/TileManager.java
TileManager.getTile
public Tile getTile (int fqTileId, TileSet.Colorizer rizer) throws NoSuchTileSetException { """ Returns the {@link Tile} object with the specified fully qualified tile id. The supplied colorizer will be used to recolor the tile. @see TileUtil#getFQTileId """ return getTile(TileUtil.getTileS...
java
public Tile getTile (int fqTileId, TileSet.Colorizer rizer) throws NoSuchTileSetException { return getTile(TileUtil.getTileSetId(fqTileId), TileUtil.getTileIndex(fqTileId), rizer); }
[ "public", "Tile", "getTile", "(", "int", "fqTileId", ",", "TileSet", ".", "Colorizer", "rizer", ")", "throws", "NoSuchTileSetException", "{", "return", "getTile", "(", "TileUtil", ".", "getTileSetId", "(", "fqTileId", ")", ",", "TileUtil", ".", "getTileIndex", ...
Returns the {@link Tile} object with the specified fully qualified tile id. The supplied colorizer will be used to recolor the tile. @see TileUtil#getFQTileId
[ "Returns", "the", "{", "@link", "Tile", "}", "object", "with", "the", "specified", "fully", "qualified", "tile", "id", ".", "The", "supplied", "colorizer", "will", "be", "used", "to", "recolor", "the", "tile", "." ]
train
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/TileManager.java#L205-L209
mapbox/mapbox-navigation-android
libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/MapboxOfflineRouter.java
MapboxOfflineRouter.findRoute
public void findRoute(@NonNull OfflineRoute route, OnOfflineRouteFoundCallback callback) { """ Uses libvalhalla and local tile data to generate mapbox-directions-api-like JSON. @param route the {@link OfflineRoute} to get a {@link DirectionsRoute} from @param callback a callback to pass back the result ...
java
public void findRoute(@NonNull OfflineRoute route, OnOfflineRouteFoundCallback callback) { offlineNavigator.retrieveRouteFor(route, callback); }
[ "public", "void", "findRoute", "(", "@", "NonNull", "OfflineRoute", "route", ",", "OnOfflineRouteFoundCallback", "callback", ")", "{", "offlineNavigator", ".", "retrieveRouteFor", "(", "route", ",", "callback", ")", ";", "}" ]
Uses libvalhalla and local tile data to generate mapbox-directions-api-like JSON. @param route the {@link OfflineRoute} to get a {@link DirectionsRoute} from @param callback a callback to pass back the result
[ "Uses", "libvalhalla", "and", "local", "tile", "data", "to", "generate", "mapbox", "-", "directions", "-", "api", "-", "like", "JSON", "." ]
train
https://github.com/mapbox/mapbox-navigation-android/blob/375a89c017d360b9defc2c90d0c03468165162ec/libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/MapboxOfflineRouter.java#L67-L69
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java
ULocale.getDisplayCountryInternal
private static String getDisplayCountryInternal(ULocale locale, ULocale displayLocale) { """ displayLocaleID is canonical, localeID need not be since parsing will fix this. """ return LocaleDisplayNames.getInstance(displayLocale) .regionDisplayName(locale.getCountry()); }
java
private static String getDisplayCountryInternal(ULocale locale, ULocale displayLocale) { return LocaleDisplayNames.getInstance(displayLocale) .regionDisplayName(locale.getCountry()); }
[ "private", "static", "String", "getDisplayCountryInternal", "(", "ULocale", "locale", ",", "ULocale", "displayLocale", ")", "{", "return", "LocaleDisplayNames", ".", "getInstance", "(", "displayLocale", ")", ".", "regionDisplayName", "(", "locale", ".", "getCountry", ...
displayLocaleID is canonical, localeID need not be since parsing will fix this.
[ "displayLocaleID", "is", "canonical", "localeID", "need", "not", "be", "since", "parsing", "will", "fix", "this", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java#L1611-L1614
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/PrimsMinimumSpanningTree.java
PrimsMinimumSpanningTree.processDense
public static <T> void processDense(T data, Adapter<T> adapter, Collector collector) { """ Run Prim's algorithm on a dense graph. @param data Data set @param adapter Adapter instance @param collector Edge collector """ // Number of nodes final int n = adapter.size(data); // Best distance for e...
java
public static <T> void processDense(T data, Adapter<T> adapter, Collector collector) { // Number of nodes final int n = adapter.size(data); // Best distance for each node double[] best = new double[n]; Arrays.fill(best, Double.POSITIVE_INFINITY); // Best previous node int[] src = new int[n];...
[ "public", "static", "<", "T", ">", "void", "processDense", "(", "T", "data", ",", "Adapter", "<", "T", ">", "adapter", ",", "Collector", "collector", ")", "{", "// Number of nodes", "final", "int", "n", "=", "adapter", ".", "size", "(", "data", ")", ";...
Run Prim's algorithm on a dense graph. @param data Data set @param adapter Adapter instance @param collector Edge collector
[ "Run", "Prim", "s", "algorithm", "on", "a", "dense", "graph", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/PrimsMinimumSpanningTree.java#L131-L177
attribyte/acp
src/main/java/org/attribyte/sql/pool/ConnectionPoolSegment.java
ConnectionPoolSegment.createRealConnection
private Connection createRealConnection(final long timeoutMillis) throws SQLException { """ Creates a real database connection, failing if one is not obtained in the specified time. @param timeoutMillis The timeout in milliseconds. @return The connection. @throws SQLException on connection problem or timeout wa...
java
private Connection createRealConnection(final long timeoutMillis) throws SQLException { if(timeoutMillis < 1L) { String usePassword = getPassword(); Connection conn = dbConnection.datasource == null ? DriverManager.getConnection(dbConnection.connectionString, dbConnection.use...
[ "private", "Connection", "createRealConnection", "(", "final", "long", "timeoutMillis", ")", "throws", "SQLException", "{", "if", "(", "timeoutMillis", "<", "1L", ")", "{", "String", "usePassword", "=", "getPassword", "(", ")", ";", "Connection", "conn", "=", ...
Creates a real database connection, failing if one is not obtained in the specified time. @param timeoutMillis The timeout in milliseconds. @return The connection. @throws SQLException on connection problem or timeout waiting for connection.
[ "Creates", "a", "real", "database", "connection", "failing", "if", "one", "is", "not", "obtained", "in", "the", "specified", "time", "." ]
train
https://github.com/attribyte/acp/blob/dbee6ebb83fda4f19fbbbcb9d0ac2b527e3cb659/src/main/java/org/attribyte/sql/pool/ConnectionPoolSegment.java#L1179-L1204
apache/groovy
src/main/java/org/apache/groovy/ast/tools/ClassNodeUtils.java
ClassNodeUtils.getField
public static FieldNode getField(ClassNode classNode, String fieldName) { """ Return the (potentially inherited) field of the classnode. @param classNode the classnode @param fieldName the name of the field @return the field or null if not found """ ClassNode node = classNode; Set<String> ...
java
public static FieldNode getField(ClassNode classNode, String fieldName) { ClassNode node = classNode; Set<String> visited = new HashSet<String>(); while (node != null) { FieldNode fn = node.getDeclaredField(fieldName); if (fn != null) return fn; ClassNode[] in...
[ "public", "static", "FieldNode", "getField", "(", "ClassNode", "classNode", ",", "String", "fieldName", ")", "{", "ClassNode", "node", "=", "classNode", ";", "Set", "<", "String", ">", "visited", "=", "new", "HashSet", "<", "String", ">", "(", ")", ";", ...
Return the (potentially inherited) field of the classnode. @param classNode the classnode @param fieldName the name of the field @return the field or null if not found
[ "Return", "the", "(", "potentially", "inherited", ")", "field", "of", "the", "classnode", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/apache/groovy/ast/tools/ClassNodeUtils.java#L396-L412
beangle/beangle3
commons/core/src/main/java/org/beangle/commons/text/i18n/impl/DefaultTextBundleRegistry.java
DefaultTextBundleRegistry.loadJavaBundle
protected Option<TextBundle> loadJavaBundle(String bundleName, Locale locale) { """ Load java properties bundle with iso-8859-1 @param bundleName @param locale @return None or bundle corresponding bindleName.locale.properties """ Properties properties = new Properties(); String resource = toJavaRe...
java
protected Option<TextBundle> loadJavaBundle(String bundleName, Locale locale) { Properties properties = new Properties(); String resource = toJavaResourceName(bundleName, locale); try { InputStream is = ClassLoaders.getResourceAsStream(resource, getClass()); if (null == is) return Option.none();...
[ "protected", "Option", "<", "TextBundle", ">", "loadJavaBundle", "(", "String", "bundleName", ",", "Locale", "locale", ")", "{", "Properties", "properties", "=", "new", "Properties", "(", ")", ";", "String", "resource", "=", "toJavaResourceName", "(", "bundleNam...
Load java properties bundle with iso-8859-1 @param bundleName @param locale @return None or bundle corresponding bindleName.locale.properties
[ "Load", "java", "properties", "bundle", "with", "iso", "-", "8859", "-", "1" ]
train
https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/core/src/main/java/org/beangle/commons/text/i18n/impl/DefaultTextBundleRegistry.java#L155-L168
salesforce/Argus
ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/DashboardResources.java
DashboardResources.getDashboardByID
@GET @Produces(MediaType.APPLICATION_JSON) @Path("/ { """ Returns a dashboard by its ID. @param req The HTTP request. @param dashboardId The dashboard ID to retrieve. @return The corresponding dashboard. @throws WebApplicationException If no corresponding dashboard exists. """dashb...
java
@GET @Produces(MediaType.APPLICATION_JSON) @Path("/{dashboardId}") @Description("Returns a dashboard by its ID.") public DashboardDto getDashboardByID(@Context HttpServletRequest req, @PathParam("dashboardId") BigInteger dashboardId) { if (dashboardId == null || dashboardId.compareTo(BigInteger.ZERO) < 1) { ...
[ "@", "GET", "@", "Produces", "(", "MediaType", ".", "APPLICATION_JSON", ")", "@", "Path", "(", "\"/{dashboardId}\"", ")", "@", "Description", "(", "\"Returns a dashboard by its ID.\"", ")", "public", "DashboardDto", "getDashboardByID", "(", "@", "Context", "HttpServ...
Returns a dashboard by its ID. @param req The HTTP request. @param dashboardId The dashboard ID to retrieve. @return The corresponding dashboard. @throws WebApplicationException If no corresponding dashboard exists.
[ "Returns", "a", "dashboard", "by", "its", "ID", "." ]
train
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/DashboardResources.java#L253-L273
Azure/azure-sdk-for-java
network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsInner.java
ExpressRouteCircuitsInner.createOrUpdateAsync
public Observable<ExpressRouteCircuitInner> createOrUpdateAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { """ Creates or updates an express route circuit. @param resourceGroupName The name of the resource group. @param circuitName The name of the circuit. @param para...
java
public Observable<ExpressRouteCircuitInner> createOrUpdateAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters).map(new Func1<ServiceResponse<ExpressRouteCircuitInner>, ExpressRouteCirc...
[ "public", "Observable", "<", "ExpressRouteCircuitInner", ">", "createOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "circuitName", ",", "ExpressRouteCircuitInner", "parameters", ")", "{", "return", "createOrUpdateWithServiceResponseAsync", "(", "resourceGr...
Creates or updates an express route circuit. @param resourceGroupName The name of the resource group. @param circuitName The name of the circuit. @param parameters Parameters supplied to the create or update express route circuit operation. @throws IllegalArgumentException thrown if parameters fail the validation @ret...
[ "Creates", "or", "updates", "an", "express", "route", "circuit", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsInner.java#L422-L429
RobotiumTech/robotium
robotium-solo/src/main/java/com/robotium/solo/Clicker.java
Clicker.clickOnScreen
public void clickOnScreen(View view, boolean longClick, int time) { """ Private method used to click on a given view. @param view the view that should be clicked @param longClick true if the click should be a long click @param time the amount of time to long click """ if(view == null) Assert.fail("Vi...
java
public void clickOnScreen(View view, boolean longClick, int time) { if(view == null) Assert.fail("View is null and can therefore not be clicked!"); float[] xyToClick = getClickCoordinates(view); float x = xyToClick[0]; float y = xyToClick[1]; if(x == 0 || y == 0){ sleeper.sleepMini(); try { vie...
[ "public", "void", "clickOnScreen", "(", "View", "view", ",", "boolean", "longClick", ",", "int", "time", ")", "{", "if", "(", "view", "==", "null", ")", "Assert", ".", "fail", "(", "\"View is null and can therefore not be clicked!\"", ")", ";", "float", "[", ...
Private method used to click on a given view. @param view the view that should be clicked @param longClick true if the click should be a long click @param time the amount of time to long click
[ "Private", "method", "used", "to", "click", "on", "a", "given", "view", "." ]
train
https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Clicker.java#L184-L210
jglobus/JGlobus
ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java
BouncyCastleCertProcessingFactory.createCredential
public GlobusCredential createCredential(X509Certificate[] certs, PrivateKey privateKey, int bits, int lifetime, int delegationMode) throws GeneralSecurityException { """ Creates a new proxy credential from the specified certificate chain and a private key. @see #createCredential(X509Certificate[], Priv...
java
public GlobusCredential createCredential(X509Certificate[] certs, PrivateKey privateKey, int bits, int lifetime, int delegationMode) throws GeneralSecurityException { return createCredential(certs, privateKey, bits, lifetime, delegationMode, (X509ExtensionSet) null, null); }
[ "public", "GlobusCredential", "createCredential", "(", "X509Certificate", "[", "]", "certs", ",", "PrivateKey", "privateKey", ",", "int", "bits", ",", "int", "lifetime", ",", "int", "delegationMode", ")", "throws", "GeneralSecurityException", "{", "return", "createC...
Creates a new proxy credential from the specified certificate chain and a private key. @see #createCredential(X509Certificate[], PrivateKey, int, int, int, X509ExtensionSet, String) createCredential @deprecated
[ "Creates", "a", "new", "proxy", "credential", "from", "the", "specified", "certificate", "chain", "and", "a", "private", "key", "." ]
train
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java#L174-L177
apache/groovy
subprojects/groovy-sql/src/main/java/groovy/sql/GroovyRowResult.java
GroovyRowResult.getProperty
public Object getProperty(String property) { """ Retrieve the value of the property by its (case-insensitive) name. @param property is the name of the property to look at @return the value of the property """ try { Object key = lookupKeyIgnoringCase(property); if (key != nul...
java
public Object getProperty(String property) { try { Object key = lookupKeyIgnoringCase(property); if (key != null) { return result.get(key); } throw new MissingPropertyException(property, GroovyRowResult.class); } catch (Exception e)...
[ "public", "Object", "getProperty", "(", "String", "property", ")", "{", "try", "{", "Object", "key", "=", "lookupKeyIgnoringCase", "(", "property", ")", ";", "if", "(", "key", "!=", "null", ")", "{", "return", "result", ".", "get", "(", "key", ")", ";"...
Retrieve the value of the property by its (case-insensitive) name. @param property is the name of the property to look at @return the value of the property
[ "Retrieve", "the", "value", "of", "the", "property", "by", "its", "(", "case", "-", "insensitive", ")", "name", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-sql/src/main/java/groovy/sql/GroovyRowResult.java#L48-L59
TNG/JGiven
jgiven-core/src/main/java/com/tngtech/jgiven/report/model/StepFormatter.java
StepFormatter.nextIndex
private static int nextIndex( String description, int defaultIndex ) { """ Returns the next index of the argument by decrementing 1 from the possibly parsed number @param description this String will be searched from the start for a number @param defaultIndex this will be returned if the match does not succeed...
java
private static int nextIndex( String description, int defaultIndex ) { Pattern startsWithNumber = Pattern.compile( "(\\d+).*" ); Matcher matcher = startsWithNumber.matcher( description ); if( matcher.matches() ) { return Integer.parseInt( matcher.group( 1 ) ) - 1; } ...
[ "private", "static", "int", "nextIndex", "(", "String", "description", ",", "int", "defaultIndex", ")", "{", "Pattern", "startsWithNumber", "=", "Pattern", ".", "compile", "(", "\"(\\\\d+).*\"", ")", ";", "Matcher", "matcher", "=", "startsWithNumber", ".", "matc...
Returns the next index of the argument by decrementing 1 from the possibly parsed number @param description this String will be searched from the start for a number @param defaultIndex this will be returned if the match does not succeed @return the parsed index or the defaultIndex
[ "Returns", "the", "next", "index", "of", "the", "argument", "by", "decrementing", "1", "from", "the", "possibly", "parsed", "number" ]
train
https://github.com/TNG/JGiven/blob/1a69248fc6d7eb380cdc4542e3be273842889748/jgiven-core/src/main/java/com/tngtech/jgiven/report/model/StepFormatter.java#L319-L328
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/aaa/aaauser_binding.java
aaauser_binding.get
public static aaauser_binding get(nitro_service service, String username) throws Exception { """ Use this API to fetch aaauser_binding resource of given name . """ aaauser_binding obj = new aaauser_binding(); obj.set_username(username); aaauser_binding response = (aaauser_binding) obj.get_resource(servic...
java
public static aaauser_binding get(nitro_service service, String username) throws Exception{ aaauser_binding obj = new aaauser_binding(); obj.set_username(username); aaauser_binding response = (aaauser_binding) obj.get_resource(service); return response; }
[ "public", "static", "aaauser_binding", "get", "(", "nitro_service", "service", ",", "String", "username", ")", "throws", "Exception", "{", "aaauser_binding", "obj", "=", "new", "aaauser_binding", "(", ")", ";", "obj", ".", "set_username", "(", "username", ")", ...
Use this API to fetch aaauser_binding resource of given name .
[ "Use", "this", "API", "to", "fetch", "aaauser_binding", "resource", "of", "given", "name", "." ]
train
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/aaa/aaauser_binding.java#L202-L207
playn/playn
core/src/playn/core/Platform.java
Platform.reportError
public void reportError (String message, Throwable cause) { """ Called when a backend (or other framework code) encounters an exception that it can recover from, but which it would like to report in some orderly fashion. <em>NOTE:</em> this method may be called from threads other than the main PlayN thread. ...
java
public void reportError (String message, Throwable cause) { errors.emit(new Error(message, cause)); log().warn(message, cause); }
[ "public", "void", "reportError", "(", "String", "message", ",", "Throwable", "cause", ")", "{", "errors", ".", "emit", "(", "new", "Error", "(", "message", ",", "cause", ")", ")", ";", "log", "(", ")", ".", "warn", "(", "message", ",", "cause", ")", ...
Called when a backend (or other framework code) encounters an exception that it can recover from, but which it would like to report in some orderly fashion. <em>NOTE:</em> this method may be called from threads other than the main PlayN thread.
[ "Called", "when", "a", "backend", "(", "or", "other", "framework", "code", ")", "encounters", "an", "exception", "that", "it", "can", "recover", "from", "but", "which", "it", "would", "like", "to", "report", "in", "some", "orderly", "fashion", ".", "<em", ...
train
https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/core/src/playn/core/Platform.java#L99-L102
Azure/azure-sdk-for-java
sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/ServerBlobAuditingPoliciesInner.java
ServerBlobAuditingPoliciesInner.createOrUpdateAsync
public Observable<ServerBlobAuditingPolicyInner> createOrUpdateAsync(String resourceGroupName, String serverName, ServerBlobAuditingPolicyInner parameters) { """ Creates or updates a server's blob auditing policy. @param resourceGroupName The name of the resource group that contains the resource. You can obtain...
java
public Observable<ServerBlobAuditingPolicyInner> createOrUpdateAsync(String resourceGroupName, String serverName, ServerBlobAuditingPolicyInner parameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1<ServiceResponse<ServerBlobAuditingPolicyInner>, Ser...
[ "public", "Observable", "<", "ServerBlobAuditingPolicyInner", ">", "createOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "serverName", ",", "ServerBlobAuditingPolicyInner", "parameters", ")", "{", "return", "createOrUpdateWithServiceResponseAsync", "(", "r...
Creates or updates a server's blob auditing policy. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param serverName The name of the server. @param parameters Properties of blob auditing policy @throws Ill...
[ "Creates", "or", "updates", "a", "server", "s", "blob", "auditing", "policy", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/ServerBlobAuditingPoliciesInner.java#L196-L203
paymill/paymill-java
src/main/java/com/paymill/services/RefundService.java
RefundService.refundTransaction
public Refund refundTransaction( Transaction transaction, Integer amount, String description ) { """ This function refunds a {@link Transaction} that has been created previously and was refunded in parts or wasn't refunded at all. The inserted amount will be refunded to the credit card / direct debit of the origi...
java
public Refund refundTransaction( Transaction transaction, Integer amount, String description ) { ValidationUtils.validatesAmount( amount ); ParameterMap<String, String> params = new ParameterMap<String, String>(); params.add( "amount", String.valueOf( amount ) ); if( StringUtils.isNotBlank( description...
[ "public", "Refund", "refundTransaction", "(", "Transaction", "transaction", ",", "Integer", "amount", ",", "String", "description", ")", "{", "ValidationUtils", ".", "validatesAmount", "(", "amount", ")", ";", "ParameterMap", "<", "String", ",", "String", ">", "...
This function refunds a {@link Transaction} that has been created previously and was refunded in parts or wasn't refunded at all. The inserted amount will be refunded to the credit card / direct debit of the original {@link Transaction}. There will be some fees for the merchant for every refund. <p> Note: <ul> <li>You ...
[ "This", "function", "refunds", "a", "{" ]
train
https://github.com/paymill/paymill-java/blob/17281a0d4376c76f1711af9f09bfc138c90ba65a/src/main/java/com/paymill/services/RefundService.java#L180-L189
fcrepo3/fcrepo
fcrepo-server/src/main/java/org/fcrepo/server/access/defaultdisseminator/DefaultDisseminatorImpl.java
DefaultDisseminatorImpl.viewMethodIndex
public MIMETypedStream viewMethodIndex() throws ServerException { """ Returns an HTML rendering of the Dissemination Index for the object. The Dissemination Index is a list of method definitions that represent all disseminations possible on the object. The Dissemination Index is returned as HTML in a presentati...
java
public MIMETypedStream viewMethodIndex() throws ServerException { // sdp: the dissemination index is disabled for service definition and deployment objects // so send back a message saying so. if (reader.hasContentModel(Models.SERVICE_DEFINITION_3_0) || reader.hasContentModel(Mod...
[ "public", "MIMETypedStream", "viewMethodIndex", "(", ")", "throws", "ServerException", "{", "// sdp: the dissemination index is disabled for service definition and deployment objects", "// so send back a message saying so.", "if", "(", "reader", ".", "hasContentModel", "(", "Models",...
Returns an HTML rendering of the Dissemination Index for the object. The Dissemination Index is a list of method definitions that represent all disseminations possible on the object. The Dissemination Index is returned as HTML in a presentation-oriented format. This is accomplished by doing an XSLT transform on the XML...
[ "Returns", "an", "HTML", "rendering", "of", "the", "Dissemination", "Index", "for", "the", "object", ".", "The", "Dissemination", "Index", "is", "a", "list", "of", "method", "definitions", "that", "represent", "all", "disseminations", "possible", "on", "the", ...
train
https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/access/defaultdisseminator/DefaultDisseminatorImpl.java#L158-L203
adorsys/hbci4java-adorsys
src/main/java/org/kapott/hbci/GV/generators/PainGeneratorFactory.java
PainGeneratorFactory.get
public static PainGeneratorIf get(String jobname, SepaVersion version) throws ClassNotFoundException, InstantiationException, IllegalAccessException { """ Gibt den passenden SEPA Generator für die angegebene PAIN-Version. @param jobname der Job-Name. Z.Bsp. "UebSEPA". @param version die PAIN-Version. ...
java
public static PainGeneratorIf get(String jobname, SepaVersion version) throws ClassNotFoundException, InstantiationException, IllegalAccessException { if (!version.canGenerate(jobname)) throw new InvalidUserDataException("SEPA version is not supported: " + version); String className...
[ "public", "static", "PainGeneratorIf", "get", "(", "String", "jobname", ",", "SepaVersion", "version", ")", "throws", "ClassNotFoundException", ",", "InstantiationException", ",", "IllegalAccessException", "{", "if", "(", "!", "version", ".", "canGenerate", "(", "jo...
Gibt den passenden SEPA Generator für die angegebene PAIN-Version. @param jobname der Job-Name. Z.Bsp. "UebSEPA". @param version die PAIN-Version. @return ISEPAGenerator @throws ClassNotFoundException @throws IllegalAccessException @throws InstantiationException
[ "Gibt", "den", "passenden", "SEPA", "Generator", "für", "die", "angegebene", "PAIN", "-", "Version", "." ]
train
https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/GV/generators/PainGeneratorFactory.java#L47-L56
theHilikus/Event-manager
src/main/java/com/github/thehilikus/events/event_manager/SubscriptionManager.java
SubscriptionManager.subscribe
public <T extends EventListener> void subscribe(EventPublisher source, T listener) { """ Binds a listener to a publisher @param source the event publisher @param listener the event receiver """ if (source == null || listener == null) { throw new IllegalArgumentException("Parameters cannot be null"); ...
java
public <T extends EventListener> void subscribe(EventPublisher source, T listener) { if (source == null || listener == null) { throw new IllegalArgumentException("Parameters cannot be null"); } log.debug("[subscribe] Adding {} --> {}", source.getClass().getName(), listener.getClass().getName()); GenericEventD...
[ "public", "<", "T", "extends", "EventListener", ">", "void", "subscribe", "(", "EventPublisher", "source", ",", "T", "listener", ")", "{", "if", "(", "source", "==", "null", "||", "listener", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException"...
Binds a listener to a publisher @param source the event publisher @param listener the event receiver
[ "Binds", "a", "listener", "to", "a", "publisher" ]
train
https://github.com/theHilikus/Event-manager/blob/c3dabf5a145e57b2a6de89c1910851b8a8ae6064/src/main/java/com/github/thehilikus/events/event_manager/SubscriptionManager.java#L30-L44
Alfresco/alfresco-sdk
plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/AbstractRefreshWebappMojo.java
AbstractRefreshWebappMojo.makePostCall
private void makePostCall(URL alfrescoTomcatUrl, List<NameValuePair> postData, String operation) { """ Helper method to make a POST request to the Alfresco Webapp @param alfrescoTomcatUrl the URL for the webapp we want to post to @param postData the POST data that should be sent @param operation information a...
java
private void makePostCall(URL alfrescoTomcatUrl, List<NameValuePair> postData, String operation) { CloseableHttpClient client = null; CloseableHttpResponse response = null; try { // Set up a HTTP POST request to the Alfresco Webapp we are targeting HttpHost targetHost = n...
[ "private", "void", "makePostCall", "(", "URL", "alfrescoTomcatUrl", ",", "List", "<", "NameValuePair", ">", "postData", ",", "String", "operation", ")", "{", "CloseableHttpClient", "client", "=", "null", ";", "CloseableHttpResponse", "response", "=", "null", ";", ...
Helper method to make a POST request to the Alfresco Webapp @param alfrescoTomcatUrl the URL for the webapp we want to post to @param postData the POST data that should be sent @param operation information about the operation we are performing
[ "Helper", "method", "to", "make", "a", "POST", "request", "to", "the", "Alfresco", "Webapp" ]
train
https://github.com/Alfresco/alfresco-sdk/blob/7f861a96726edb776293e2363ee85ef05643368b/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/AbstractRefreshWebappMojo.java#L211-L271
OpenLiberty/open-liberty
dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/execution/impl/RuntimeJobExecution.java
RuntimeJobExecution.publishEvent
private void publishEvent(WSJobExecution objectToPublish, String eventToPublishTo) { """ Publish jms topic if batch jms event is available @param objectToPublish WSJobExecution @param eventToPublish """ if (getBatchEventsPublisher() != null) { getBatchEventsPublisher().publishJobExecuti...
java
private void publishEvent(WSJobExecution objectToPublish, String eventToPublishTo) { if (getBatchEventsPublisher() != null) { getBatchEventsPublisher().publishJobExecutionEvent(objectToPublish, eventToPublishTo, correlationId); } }
[ "private", "void", "publishEvent", "(", "WSJobExecution", "objectToPublish", ",", "String", "eventToPublishTo", ")", "{", "if", "(", "getBatchEventsPublisher", "(", ")", "!=", "null", ")", "{", "getBatchEventsPublisher", "(", ")", ".", "publishJobExecutionEvent", "(...
Publish jms topic if batch jms event is available @param objectToPublish WSJobExecution @param eventToPublish
[ "Publish", "jms", "topic", "if", "batch", "jms", "event", "is", "available" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/execution/impl/RuntimeJobExecution.java#L163-L167
fozziethebeat/S-Space
src/main/java/edu/ucla/sspace/util/WorkQueue.java
WorkQueue.run
public void run(Collection<Runnable> tasks) { """ Executes the tasks using a thread pool and returns once all tasks have finished. @throws IllegalStateException if interrupted while waiting for the tasks to finish """ // Create a semphore that the wrapped runnables will execute int numTask...
java
public void run(Collection<Runnable> tasks) { // Create a semphore that the wrapped runnables will execute int numTasks = tasks.size(); CountDownLatch latch = new CountDownLatch(numTasks); for (Runnable r : tasks) { if (r == null) throw new NullPointerExceptio...
[ "public", "void", "run", "(", "Collection", "<", "Runnable", ">", "tasks", ")", "{", "// Create a semphore that the wrapped runnables will execute", "int", "numTasks", "=", "tasks", ".", "size", "(", ")", ";", "CountDownLatch", "latch", "=", "new", "CountDownLatch",...
Executes the tasks using a thread pool and returns once all tasks have finished. @throws IllegalStateException if interrupted while waiting for the tasks to finish
[ "Executes", "the", "tasks", "using", "a", "thread", "pool", "and", "returns", "once", "all", "tasks", "have", "finished", "." ]
train
https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/util/WorkQueue.java#L309-L325
MGunlogson/CuckooFilter4J
src/main/java/com/github/mgunlogson/cuckoofilter4j/SegmentedBucketLocker.java
SegmentedBucketLocker.unlockBucketsWrite
void unlockBucketsWrite(long i1, long i2) { """ Unlocks segments corresponding to bucket indexes in specific order to prevent deadlocks """ int bucket1LockIdx = getBucketLock(i1); int bucket2LockIdx = getBucketLock(i2); // always unlock segments in same order to avoid deadlocks if (bucket1LockIdx =...
java
void unlockBucketsWrite(long i1, long i2) { int bucket1LockIdx = getBucketLock(i1); int bucket2LockIdx = getBucketLock(i2); // always unlock segments in same order to avoid deadlocks if (bucket1LockIdx == bucket2LockIdx) { lockAry[bucket1LockIdx].tryUnlockWrite(); return; } lockAry[bucket1Lock...
[ "void", "unlockBucketsWrite", "(", "long", "i1", ",", "long", "i2", ")", "{", "int", "bucket1LockIdx", "=", "getBucketLock", "(", "i1", ")", ";", "int", "bucket2LockIdx", "=", "getBucketLock", "(", "i2", ")", ";", "// always unlock segments in same order to avoid ...
Unlocks segments corresponding to bucket indexes in specific order to prevent deadlocks
[ "Unlocks", "segments", "corresponding", "to", "bucket", "indexes", "in", "specific", "order", "to", "prevent", "deadlocks" ]
train
https://github.com/MGunlogson/CuckooFilter4J/blob/e8472aa150b201f05046d1c81cac5a5ca4348db8/src/main/java/com/github/mgunlogson/cuckoofilter4j/SegmentedBucketLocker.java#L103-L113
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java
SQLiteDatabase.insertOrThrow
public long insertOrThrow(String table, String nullColumnHack, ContentValues values) throws SQLException { """ Convenience method for inserting a row into the database. @param table the table to insert the row into @param nullColumnHack optional; may be <code>null</code>. SQL doesn't allow inserti...
java
public long insertOrThrow(String table, String nullColumnHack, ContentValues values) throws SQLException { return insertWithOnConflict(table, nullColumnHack, values, CONFLICT_NONE); }
[ "public", "long", "insertOrThrow", "(", "String", "table", ",", "String", "nullColumnHack", ",", "ContentValues", "values", ")", "throws", "SQLException", "{", "return", "insertWithOnConflict", "(", "table", ",", "nullColumnHack", ",", "values", ",", "CONFLICT_NONE"...
Convenience method for inserting a row into the database. @param table the table to insert the row into @param nullColumnHack optional; may be <code>null</code>. SQL doesn't allow inserting a completely empty row without naming at least one column name. If your provided <code>values</code> is empty, no column names a...
[ "Convenience", "method", "for", "inserting", "a", "row", "into", "the", "database", "." ]
train
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java#L1369-L1372
jbundle/jbundle
app/program/script/src/main/java/org/jbundle/app/program/script/data/importfix/base/MergeData.java
MergeData.mergeSourceData
public void mergeSourceData(Record recSource, Record recDest, boolean bFound) { """ Merge this source record with the destination record. @param recSource @param recDest. """ for (int iFieldSeq = 0; iFieldSeq < recSource.getFieldCount(); iFieldSeq++) { BaseField fldSource = recSou...
java
public void mergeSourceData(Record recSource, Record recDest, boolean bFound) { for (int iFieldSeq = 0; iFieldSeq < recSource.getFieldCount(); iFieldSeq++) { BaseField fldSource = recSource.getField(iFieldSeq); BaseField fldDest = recDest.getField(fldSource.getFieldName()); ...
[ "public", "void", "mergeSourceData", "(", "Record", "recSource", ",", "Record", "recDest", ",", "boolean", "bFound", ")", "{", "for", "(", "int", "iFieldSeq", "=", "0", ";", "iFieldSeq", "<", "recSource", ".", "getFieldCount", "(", ")", ";", "iFieldSeq", "...
Merge this source record with the destination record. @param recSource @param recDest.
[ "Merge", "this", "source", "record", "with", "the", "destination", "record", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/app/program/script/src/main/java/org/jbundle/app/program/script/data/importfix/base/MergeData.java#L122-L132
fcrepo3/fcrepo
fcrepo-server/src/main/java/org/fcrepo/server/rest/DatastreamFilenameHelper.java
DatastreamFilenameHelper.getExtension
private static final String getExtension(String filename, String mappingType, String MIMETYPE) throws Exception { """ Get a filename extension for a datastream based on mime-type to extension mapping. mappingType may be: <li>never: never look up extension <li>ifmissing: if the given filename already contains an...
java
private static final String getExtension(String filename, String mappingType, String MIMETYPE) throws Exception { String extension = ""; if (mappingType.equals("never")) { extension = ""; } else { // if mapping specifies ifmissing and filename contains an extension; exten...
[ "private", "static", "final", "String", "getExtension", "(", "String", "filename", ",", "String", "mappingType", ",", "String", "MIMETYPE", ")", "throws", "Exception", "{", "String", "extension", "=", "\"\"", ";", "if", "(", "mappingType", ".", "equals", "(", ...
Get a filename extension for a datastream based on mime-type to extension mapping. mappingType may be: <li>never: never look up extension <li>ifmissing: if the given filename already contains an extension return nothing, otherwise look up an extension <li>always: always look up an extension
[ "Get", "a", "filename", "extension", "for", "a", "datastream", "based", "on", "mime", "-", "type", "to", "extension", "mapping", ".", "mappingType", "may", "be", ":", "<li", ">", "never", ":", "never", "look", "up", "extension", "<li", ">", "ifmissing", ...
train
https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/rest/DatastreamFilenameHelper.java#L374-L399
wildfly/wildfly-core
cli/src/main/java/org/jboss/as/cli/impl/ArgumentWithValue.java
ArgumentWithValue.getOriginalValue
public String getOriginalValue(ParsedCommandLine parsedLine, boolean required) throws CommandFormatException { """ Returns value as it appeared on the command line with escape sequences and system properties not resolved. The variables, though, are resolved during the initial parsing of the command line. @par...
java
public String getOriginalValue(ParsedCommandLine parsedLine, boolean required) throws CommandFormatException { String value = null; if(parsedLine.hasProperties()) { if(index >= 0) { List<String> others = parsedLine.getOtherProperties(); if(others.size() > inde...
[ "public", "String", "getOriginalValue", "(", "ParsedCommandLine", "parsedLine", ",", "boolean", "required", ")", "throws", "CommandFormatException", "{", "String", "value", "=", "null", ";", "if", "(", "parsedLine", ".", "hasProperties", "(", ")", ")", "{", "if"...
Returns value as it appeared on the command line with escape sequences and system properties not resolved. The variables, though, are resolved during the initial parsing of the command line. @param parsedLine parsed command line @param required whether the argument is required @return argument value as it appears o...
[ "Returns", "value", "as", "it", "appeared", "on", "the", "command", "line", "with", "escape", "sequences", "and", "system", "properties", "not", "resolved", ".", "The", "variables", "though", "are", "resolved", "during", "the", "initial", "parsing", "of", "the...
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/cli/src/main/java/org/jboss/as/cli/impl/ArgumentWithValue.java#L159-L183
alipay/sofa-rpc
core/api/src/main/java/com/alipay/sofa/rpc/core/response/SofaResponse.java
SofaResponse.addResponseProp
public void addResponseProp(String key, String value) { """ Add response prop. @param key the key @param value the value """ if (responseProps == null) { responseProps = new HashMap<String, String>(16); } if (key != null && value != null) { responseProps.pu...
java
public void addResponseProp(String key, String value) { if (responseProps == null) { responseProps = new HashMap<String, String>(16); } if (key != null && value != null) { responseProps.put(key, value); } }
[ "public", "void", "addResponseProp", "(", "String", "key", ",", "String", "value", ")", "{", "if", "(", "responseProps", "==", "null", ")", "{", "responseProps", "=", "new", "HashMap", "<", "String", ",", "String", ">", "(", "16", ")", ";", "}", "if", ...
Add response prop. @param key the key @param value the value
[ "Add", "response", "prop", "." ]
train
https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/api/src/main/java/com/alipay/sofa/rpc/core/response/SofaResponse.java#L131-L138
liferay/com-liferay-commerce
commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java
CommerceDiscountPersistenceImpl.removeByUuid_C
@Override public void removeByUuid_C(String uuid, long companyId) { """ Removes all the commerce discounts where uuid = &#63; and companyId = &#63; from the database. @param uuid the uuid @param companyId the company ID """ for (CommerceDiscount commerceDiscount : findByUuid_C(uuid, companyId, Query...
java
@Override public void removeByUuid_C(String uuid, long companyId) { for (CommerceDiscount commerceDiscount : findByUuid_C(uuid, companyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(commerceDiscount); } }
[ "@", "Override", "public", "void", "removeByUuid_C", "(", "String", "uuid", ",", "long", "companyId", ")", "{", "for", "(", "CommerceDiscount", "commerceDiscount", ":", "findByUuid_C", "(", "uuid", ",", "companyId", ",", "QueryUtil", ".", "ALL_POS", ",", "Quer...
Removes all the commerce discounts where uuid = &#63; and companyId = &#63; from the database. @param uuid the uuid @param companyId the company ID
[ "Removes", "all", "the", "commerce", "discounts", "where", "uuid", "=", "&#63", ";", "and", "companyId", "=", "&#63", ";", "from", "the", "database", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java#L1407-L1413
chr78rm/tracelogger
src/main/java/de/christofreichardt/diagnosis/file/FileTracerLog4jTee.java
FileTracerLog4jTee.adapt
@Override protected void adapt(LogLevel logLevel, Throwable throwable, Class clazz) { """ Routes the given information to the log4j system. @param logLevel {@inheritDoc} @param throwable {@inheritDoc} @param clazz {@inheritDoc} """ Logger logger = Logger.getLogger(clazz); Level level = conver...
java
@Override protected void adapt(LogLevel logLevel, Throwable throwable, Class clazz) { Logger logger = Logger.getLogger(clazz); Level level = convertToLog4jLevel(logLevel); logger.log(DebugLogTee.class.getName(), level, throwable.getMessage(), throwable); }
[ "@", "Override", "protected", "void", "adapt", "(", "LogLevel", "logLevel", ",", "Throwable", "throwable", ",", "Class", "clazz", ")", "{", "Logger", "logger", "=", "Logger", ".", "getLogger", "(", "clazz", ")", ";", "Level", "level", "=", "convertToLog4jLev...
Routes the given information to the log4j system. @param logLevel {@inheritDoc} @param throwable {@inheritDoc} @param clazz {@inheritDoc}
[ "Routes", "the", "given", "information", "to", "the", "log4j", "system", "." ]
train
https://github.com/chr78rm/tracelogger/blob/ad22452b20f8111ad4d367302c2b26a100a20200/src/main/java/de/christofreichardt/diagnosis/file/FileTracerLog4jTee.java#L77-L83
cloudiator/flexiant-client
src/main/java/de/uniulm/omi/cloudiator/flexiant/client/compute/FlexiantComputeClient.java
FlexiantComputeClient.deleteResource
protected void deleteResource(final String uuid) throws FlexiantException { """ Deletes a resource (and all related entities) identified by the given uuid. @param uuid of the resource. @throws FlexiantException if the resource can not be deleted. """ try { final Job job = this.getServic...
java
protected void deleteResource(final String uuid) throws FlexiantException { try { final Job job = this.getService().deleteResource(uuid, true, null); this.waitForJob(job); } catch (ExtilityException e) { throw new FlexiantException("Could not delete resource", e); ...
[ "protected", "void", "deleteResource", "(", "final", "String", "uuid", ")", "throws", "FlexiantException", "{", "try", "{", "final", "Job", "job", "=", "this", ".", "getService", "(", ")", ".", "deleteResource", "(", "uuid", ",", "true", ",", "null", ")", ...
Deletes a resource (and all related entities) identified by the given uuid. @param uuid of the resource. @throws FlexiantException if the resource can not be deleted.
[ "Deletes", "a", "resource", "(", "and", "all", "related", "entities", ")", "identified", "by", "the", "given", "uuid", "." ]
train
https://github.com/cloudiator/flexiant-client/blob/30024501a6ae034ea3646f71ec0761c8bc5daa69/src/main/java/de/uniulm/omi/cloudiator/flexiant/client/compute/FlexiantComputeClient.java#L362-L369
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java
PageFlowUtils.getCurrentActionResolver
public static ActionResolver getCurrentActionResolver( HttpServletRequest request ) { """ Get the current ActionResolver. @deprecated Use {@link #getCurrentPageFlow(HttpServletRequest, ServletContext)} instead. @return the current ActionResolver from the user session, or <code>null</code> if there is none. ...
java
public static ActionResolver getCurrentActionResolver( HttpServletRequest request ) { ServletContext servletContext = InternalUtils.getServletContext( request ); return getCurrentActionResolver( request, servletContext ); }
[ "public", "static", "ActionResolver", "getCurrentActionResolver", "(", "HttpServletRequest", "request", ")", "{", "ServletContext", "servletContext", "=", "InternalUtils", ".", "getServletContext", "(", "request", ")", ";", "return", "getCurrentActionResolver", "(", "requ...
Get the current ActionResolver. @deprecated Use {@link #getCurrentPageFlow(HttpServletRequest, ServletContext)} instead. @return the current ActionResolver from the user session, or <code>null</code> if there is none.
[ "Get", "the", "current", "ActionResolver", ".", "@deprecated", "Use", "{", "@link", "#getCurrentPageFlow", "(", "HttpServletRequest", "ServletContext", ")", "}", "instead", "." ]
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java#L285-L289
JOML-CI/JOML
src/org/joml/Intersectionf.java
Intersectionf.distancePointLine
public static float distancePointLine(float pX, float pY, float pZ, float x0, float y0, float z0, float x1, float y1, float z1) { """ Compute the distance of the given point <code>(pX, pY, pZ)</code> to the line defined by the two points <code>(x0, y0, z0)</code> and <code>(x1, y1, z1)</code>. <p> R...
java
public static float distancePointLine(float pX, float pY, float pZ, float x0, float y0, float z0, float x1, float y1, float z1) { float d21x = x1 - x0, d21y = y1 - y0, d21z = z1 - z0; float d10x = x0 - pX, d10y = y0 - pY, d10z = z0 - pZ; float cx = d21y * d10z - d21z * d10y, cy = d2...
[ "public", "static", "float", "distancePointLine", "(", "float", "pX", ",", "float", "pY", ",", "float", "pZ", ",", "float", "x0", ",", "float", "y0", ",", "float", "z0", ",", "float", "x1", ",", "float", "y1", ",", "float", "z1", ")", "{", "float", ...
Compute the distance of the given point <code>(pX, pY, pZ)</code> to the line defined by the two points <code>(x0, y0, z0)</code> and <code>(x1, y1, z1)</code>. <p> Reference: <a href="http://mathworld.wolfram.com/Point-LineDistance3-Dimensional.html">http://mathworld.wolfram.com</a> @param pX the x coordinate of the ...
[ "Compute", "the", "distance", "of", "the", "given", "point", "<code", ">", "(", "pX", "pY", "pZ", ")", "<", "/", "code", ">", "to", "the", "line", "defined", "by", "the", "two", "points", "<code", ">", "(", "x0", "y0", "z0", ")", "<", "/", "code"...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Intersectionf.java#L3882-L3888
basho/riak-java-client
src/main/java/com/basho/riak/client/api/RiakClient.java
RiakClient.newClient
public static RiakClient newClient(String... remoteAddresses) throws UnknownHostException { """ Static factory method to create a new client instance. This method produces a client connected to the supplied addresses on the default (protocol buffers) port (8087). @param remoteAddresses a list of IP addresses or...
java
public static RiakClient newClient(String... remoteAddresses) throws UnknownHostException { return newClient(RiakNode.Builder.DEFAULT_REMOTE_PORT, Arrays.asList(remoteAddresses)); }
[ "public", "static", "RiakClient", "newClient", "(", "String", "...", "remoteAddresses", ")", "throws", "UnknownHostException", "{", "return", "newClient", "(", "RiakNode", ".", "Builder", ".", "DEFAULT_REMOTE_PORT", ",", "Arrays", ".", "asList", "(", "remoteAddresse...
Static factory method to create a new client instance. This method produces a client connected to the supplied addresses on the default (protocol buffers) port (8087). @param remoteAddresses a list of IP addresses or hostnames @return a new client instance @throws UnknownHostException if a supplied hostname cannot be r...
[ "Static", "factory", "method", "to", "create", "a", "new", "client", "instance", ".", "This", "method", "produces", "a", "client", "connected", "to", "the", "supplied", "addresses", "on", "the", "default", "(", "protocol", "buffers", ")", "port", "(", "8087"...
train
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/api/RiakClient.java#L231-L234
docusign/docusign-java-client
src/main/java/com/docusign/esign/api/ConnectApi.java
ConnectApi.getEventLog
public ConnectLog getEventLog(String accountId, String logId) throws ApiException { """ Get the specified Connect log entry. Retrieves the specified Connect log entry for your account. ###### Note: The &#x60;enableLog&#x60; setting in the Connect configuration must be set to true to enable logging. If logging is...
java
public ConnectLog getEventLog(String accountId, String logId) throws ApiException { return getEventLog(accountId, logId, null); }
[ "public", "ConnectLog", "getEventLog", "(", "String", "accountId", ",", "String", "logId", ")", "throws", "ApiException", "{", "return", "getEventLog", "(", "accountId", ",", "logId", ",", "null", ")", ";", "}" ]
Get the specified Connect log entry. Retrieves the specified Connect log entry for your account. ###### Note: The &#x60;enableLog&#x60; setting in the Connect configuration must be set to true to enable logging. If logging is not enabled, then no log entries are recorded. @param accountId The external account number (...
[ "Get", "the", "specified", "Connect", "log", "entry", ".", "Retrieves", "the", "specified", "Connect", "log", "entry", "for", "your", "account", ".", "######", "Note", ":", "The", "&#x60", ";", "enableLog&#x60", ";", "setting", "in", "the", "Connect", "confi...
train
https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/ConnectApi.java#L349-L351
xwiki/xwiki-rendering
xwiki-rendering-wikimodel/src/main/java/org/xwiki/rendering/wikimodel/impl/InternalWikiScannerContext.java
InternalWikiScannerContext.onMacro
public void onMacro(String name, WikiParameters params, String content) { """ Waiting for following events to know if the macro is inline or not. """ checkBlockContainer(); fMacroName = name; fMacroParameters = params; fMacroContent = content; }
java
public void onMacro(String name, WikiParameters params, String content) { checkBlockContainer(); fMacroName = name; fMacroParameters = params; fMacroContent = content; }
[ "public", "void", "onMacro", "(", "String", "name", ",", "WikiParameters", "params", ",", "String", "content", ")", "{", "checkBlockContainer", "(", ")", ";", "fMacroName", "=", "name", ";", "fMacroParameters", "=", "params", ";", "fMacroContent", "=", "conten...
Waiting for following events to know if the macro is inline or not.
[ "Waiting", "for", "following", "events", "to", "know", "if", "the", "macro", "is", "inline", "or", "not", "." ]
train
https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-wikimodel/src/main/java/org/xwiki/rendering/wikimodel/impl/InternalWikiScannerContext.java#L1013-L1020
aspectran/aspectran
core/src/main/java/com/aspectran/core/support/i18n/message/MessageSourceSupport.java
MessageSourceSupport.renderDefaultMessage
protected String renderDefaultMessage(String defaultMessage, Object[] args, Locale locale) { """ Render the given default message String. The default message is passed in as specified by the caller and can be rendered into a fully formatted default message shown to the user. <p>The default implementation passes...
java
protected String renderDefaultMessage(String defaultMessage, Object[] args, Locale locale) { return formatMessage(defaultMessage, args, locale); }
[ "protected", "String", "renderDefaultMessage", "(", "String", "defaultMessage", ",", "Object", "[", "]", "args", ",", "Locale", "locale", ")", "{", "return", "formatMessage", "(", "defaultMessage", ",", "args", ",", "locale", ")", ";", "}" ]
Render the given default message String. The default message is passed in as specified by the caller and can be rendered into a fully formatted default message shown to the user. <p>The default implementation passes the String to {@code formatMessage}, resolving any argument placeholders found in them. Subclasses may o...
[ "Render", "the", "given", "default", "message", "String", ".", "The", "default", "message", "is", "passed", "in", "as", "specified", "by", "the", "caller", "and", "can", "be", "rendered", "into", "a", "fully", "formatted", "default", "message", "shown", "to"...
train
https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/support/i18n/message/MessageSourceSupport.java#L98-L100
Azure/azure-sdk-for-java
network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnServerConfigurationsInner.java
P2sVpnServerConfigurationsInner.createOrUpdateAsync
public Observable<P2SVpnServerConfigurationInner> createOrUpdateAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters) { """ Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exi...
java
public Observable<P2SVpnServerConfigurationInner> createOrUpdateAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SV...
[ "public", "Observable", "<", "P2SVpnServerConfigurationInner", ">", "createOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "virtualWanName", ",", "String", "p2SVpnServerConfigurationName", ",", "P2SVpnServerConfigurationInner", "p2SVpnServerConfigurationParameter...
Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @param resourceGroupName The resource group name of the VirtualWan. @param virtualWanName The name of the VirtualWan. @param p2SVpnServerConfigurationName The name of the P2SVpnSe...
[ "Creates", "a", "P2SVpnServerConfiguration", "to", "associate", "with", "a", "VirtualWan", "if", "it", "doesn", "t", "exist", "else", "updates", "the", "existing", "P2SVpnServerConfiguration", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnServerConfigurationsInner.java#L226-L233
looly/hutool
hutool-system/src/main/java/cn/hutool/system/SystemUtil.java
SystemUtil.get
public static String get(String name, boolean quiet) { """ 取得系统属性,如果因为Java安全的限制而失败,则将错误打在Log中,然后返回 <code>null</code>。 @param name 属性名 @param quiet 安静模式,不将出错信息打在<code>System.err</code>中 @return 属性值或<code>null</code> """ try { return System.getProperty(name); } catch (SecurityException e) { ...
java
public static String get(String name, boolean quiet) { try { return System.getProperty(name); } catch (SecurityException e) { if (false == quiet) { Console.error("Caught a SecurityException reading the system property '{}'; the SystemUtil property value will default to null.", name); } return...
[ "public", "static", "String", "get", "(", "String", "name", ",", "boolean", "quiet", ")", "{", "try", "{", "return", "System", ".", "getProperty", "(", "name", ")", ";", "}", "catch", "(", "SecurityException", "e", ")", "{", "if", "(", "false", "==", ...
取得系统属性,如果因为Java安全的限制而失败,则将错误打在Log中,然后返回 <code>null</code>。 @param name 属性名 @param quiet 安静模式,不将出错信息打在<code>System.err</code>中 @return 属性值或<code>null</code>
[ "取得系统属性,如果因为Java安全的限制而失败,则将错误打在Log中,然后返回", "<code", ">", "null<", "/", "code", ">", "。" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-system/src/main/java/cn/hutool/system/SystemUtil.java#L118-L127
wildfly/wildfly-core
cli/src/main/java/org/jboss/as/cli/handlers/BaseOperationCommand.java
BaseOperationCommand.addRequiredPath
protected void addRequiredPath(OperationRequestAddress requiredPath) { """ Adds a node path which is required to exist before the command can be used. @param requiredPath node path which is required to exist before the command can be used. """ if(requiredPath == null) { throw new IllegalA...
java
protected void addRequiredPath(OperationRequestAddress requiredPath) { if(requiredPath == null) { throw new IllegalArgumentException("Required path can't be null."); } // there perhaps could be more but for now only one is allowed if(requiredAddress != null) { thr...
[ "protected", "void", "addRequiredPath", "(", "OperationRequestAddress", "requiredPath", ")", "{", "if", "(", "requiredPath", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Required path can't be null.\"", ")", ";", "}", "// there perhaps cou...
Adds a node path which is required to exist before the command can be used. @param requiredPath node path which is required to exist before the command can be used.
[ "Adds", "a", "node", "path", "which", "is", "required", "to", "exist", "before", "the", "command", "can", "be", "used", "." ]
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/cli/src/main/java/org/jboss/as/cli/handlers/BaseOperationCommand.java#L118-L136
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer/src/com/ibm/ws/ejbcontainer/osgi/internal/naming/EJBJavaColonNamingHelper.java
EJBJavaColonNamingHelper.processJavaColonGlobal
private Object processJavaColonGlobal(String name) throws NamingException { """ This method process lookup requests for java:global. @param name @param cmd @return the EJB object instance. @throws NamingException """ // Called to ensure that the java:global lookup code path // is coming f...
java
private Object processJavaColonGlobal(String name) throws NamingException { // Called to ensure that the java:global lookup code path // is coming from a Java EE thread. If not this will reject the // lookup with the correct Java EE error message. getComponentMetaData(JavaColonNamespace....
[ "private", "Object", "processJavaColonGlobal", "(", "String", "name", ")", "throws", "NamingException", "{", "// Called to ensure that the java:global lookup code path", "// is coming from a Java EE thread. If not this will reject the", "// lookup with the correct Java EE error message.", ...
This method process lookup requests for java:global. @param name @param cmd @return the EJB object instance. @throws NamingException
[ "This", "method", "process", "lookup", "requests", "for", "java", ":", "global", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer/src/com/ibm/ws/ejbcontainer/osgi/internal/naming/EJBJavaColonNamingHelper.java#L171-L187
j-easy/easy-random
easy-random-core/src/main/java/org/jeasy/random/util/ReflectionUtils.java
ReflectionUtils.getReadMethod
public static Optional<Method> getReadMethod(Field field) { """ Get the read method for given field. @param field field to get the read method for. @return Optional of read method or empty if field has no read method """ String fieldName = field.getName(); Class<?> fieldClass = field.getDecla...
java
public static Optional<Method> getReadMethod(Field field) { String fieldName = field.getName(); Class<?> fieldClass = field.getDeclaringClass(); String capitalizedFieldName = fieldName.substring(0, 1).toUpperCase(ENGLISH) + fieldName.substring(1); // try to find getProperty Optio...
[ "public", "static", "Optional", "<", "Method", ">", "getReadMethod", "(", "Field", "field", ")", "{", "String", "fieldName", "=", "field", ".", "getName", "(", ")", ";", "Class", "<", "?", ">", "fieldClass", "=", "field", ".", "getDeclaringClass", "(", "...
Get the read method for given field. @param field field to get the read method for. @return Optional of read method or empty if field has no read method
[ "Get", "the", "read", "method", "for", "given", "field", "." ]
train
https://github.com/j-easy/easy-random/blob/816b0d6a74c7288af111e70ae1b0b57d7fe3b59d/easy-random-core/src/main/java/org/jeasy/random/util/ReflectionUtils.java#L510-L521
Mozu/mozu-java
mozu-java-core/src/main/java/com/mozu/api/urls/commerce/orders/PaymentUrl.java
PaymentUrl.getAvailablePaymentActionsUrl
public static MozuUrl getAvailablePaymentActionsUrl(String orderId, String paymentId) { """ Get Resource Url for GetAvailablePaymentActions @param orderId Unique identifier of the order. @param paymentId Unique identifier of the payment for which to perform the action. @return String Resource Url """ U...
java
public static MozuUrl getAvailablePaymentActionsUrl(String orderId, String paymentId) { UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/payments/{paymentId}/actions"); formatter.formatUrl("orderId", orderId); formatter.formatUrl("paymentId", paymentId); return new MozuUrl(formatt...
[ "public", "static", "MozuUrl", "getAvailablePaymentActionsUrl", "(", "String", "orderId", ",", "String", "paymentId", ")", "{", "UrlFormatter", "formatter", "=", "new", "UrlFormatter", "(", "\"/api/commerce/orders/{orderId}/payments/{paymentId}/actions\"", ")", ";", "format...
Get Resource Url for GetAvailablePaymentActions @param orderId Unique identifier of the order. @param paymentId Unique identifier of the payment for which to perform the action. @return String Resource Url
[ "Get", "Resource", "Url", "for", "GetAvailablePaymentActions" ]
train
https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/orders/PaymentUrl.java#L36-L42
op4j/op4j
src/main/java/org/op4j/functions/FnString.java
FnString.toInteger
public static final Function<String,Integer> toInteger(final RoundingMode roundingMode, final DecimalPoint decimalPoint) { """ <p> Converts a String into an Integer, using the specified decimal point configuration ({@link DecimalPoint}). Rounding mode is used for removing the decimal part of the number. The tar...
java
public static final Function<String,Integer> toInteger(final RoundingMode roundingMode, final DecimalPoint decimalPoint) { return new ToInteger(roundingMode, decimalPoint); }
[ "public", "static", "final", "Function", "<", "String", ",", "Integer", ">", "toInteger", "(", "final", "RoundingMode", "roundingMode", ",", "final", "DecimalPoint", "decimalPoint", ")", "{", "return", "new", "ToInteger", "(", "roundingMode", ",", "decimalPoint", ...
<p> Converts a String into an Integer, using the specified decimal point configuration ({@link DecimalPoint}). Rounding mode is used for removing the decimal part of the number. The target String should contain no thousand separators. The integer part of the input string must be between {@link Integer#MIN_VALUE} and {@...
[ "<p", ">", "Converts", "a", "String", "into", "an", "Integer", "using", "the", "specified", "decimal", "point", "configuration", "(", "{", "@link", "DecimalPoint", "}", ")", ".", "Rounding", "mode", "is", "used", "for", "removing", "the", "decimal", "part", ...
train
https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/functions/FnString.java#L938-L940
seancfoley/IPAddress
IPAddress/src/inet.ipaddr/inet/ipaddr/IPAddressSegment.java
IPAddressSegment.isMaskCompatibleWithRange
public boolean isMaskCompatibleWithRange(int maskValue, Integer segmentPrefixLength) throws PrefixLenException { """ Check that the range resulting from the mask is contiguous, otherwise we cannot represent it. For instance, for the range 0 to 3 (bits are 00 to 11), if we mask all 4 numbers from 0 to 3 with 2 (...
java
public boolean isMaskCompatibleWithRange(int maskValue, Integer segmentPrefixLength) throws PrefixLenException { if(!isMultiple()) { return true; } return super.isMaskCompatibleWithRange(maskValue, segmentPrefixLength, getNetwork().getPrefixConfiguration().allPrefixedAddressesAreSubnets()); }
[ "public", "boolean", "isMaskCompatibleWithRange", "(", "int", "maskValue", ",", "Integer", "segmentPrefixLength", ")", "throws", "PrefixLenException", "{", "if", "(", "!", "isMultiple", "(", ")", ")", "{", "return", "true", ";", "}", "return", "super", ".", "i...
Check that the range resulting from the mask is contiguous, otherwise we cannot represent it. For instance, for the range 0 to 3 (bits are 00 to 11), if we mask all 4 numbers from 0 to 3 with 2 (ie bits are 10), then we are left with 1 and 3. 2 is not included. So we cannot represent 1 and 3 as a contiguous range. ...
[ "Check", "that", "the", "range", "resulting", "from", "the", "mask", "is", "contiguous", "otherwise", "we", "cannot", "represent", "it", "." ]
train
https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/IPAddressSegment.java#L320-L325
apiman/apiman
manager/api/es/src/main/java/io/apiman/manager/api/es/EsMarshalling.java
EsMarshalling.unmarshallClientSummary
public static ClientSummaryBean unmarshallClientSummary(Map<String, Object> source) { """ Unmarshals the given map source into a bean. @param source the source @return the client summary """ if (source == null) { return null; } ClientSummaryBean bean = new ClientSummaryBea...
java
public static ClientSummaryBean unmarshallClientSummary(Map<String, Object> source) { if (source == null) { return null; } ClientSummaryBean bean = new ClientSummaryBean(); bean.setOrganizationId(asString(source.get("organizationId"))); bean.setOrganizationName(asStri...
[ "public", "static", "ClientSummaryBean", "unmarshallClientSummary", "(", "Map", "<", "String", ",", "Object", ">", "source", ")", "{", "if", "(", "source", "==", "null", ")", "{", "return", "null", ";", "}", "ClientSummaryBean", "bean", "=", "new", "ClientSu...
Unmarshals the given map source into a bean. @param source the source @return the client summary
[ "Unmarshals", "the", "given", "map", "source", "into", "a", "bean", "." ]
train
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/es/src/main/java/io/apiman/manager/api/es/EsMarshalling.java#L1042-L1054
h2oai/h2o-3
h2o-core/src/main/java/water/rapids/ast/prims/operators/AstBinOp.java
AstBinOp.cleanCategorical
private ValFrame cleanCategorical(Frame oldfr, Frame newfr) { """ Ops do not make sense on categoricals, except EQ/NE; flip such ops to NAs """ final boolean categoricalOK = categoricalOK(); final Vec oldvecs[] = oldfr.vecs(); final Vec newvecs[] = newfr.vecs(); Futures fs = new Futures(); ...
java
private ValFrame cleanCategorical(Frame oldfr, Frame newfr) { final boolean categoricalOK = categoricalOK(); final Vec oldvecs[] = oldfr.vecs(); final Vec newvecs[] = newfr.vecs(); Futures fs = new Futures(); for (int i = 0; i < oldvecs.length; i++) if ((oldvecs[i].isCategorical() && !categori...
[ "private", "ValFrame", "cleanCategorical", "(", "Frame", "oldfr", ",", "Frame", "newfr", ")", "{", "final", "boolean", "categoricalOK", "=", "categoricalOK", "(", ")", ";", "final", "Vec", "oldvecs", "[", "]", "=", "oldfr", ".", "vecs", "(", ")", ";", "f...
Ops do not make sense on categoricals, except EQ/NE; flip such ops to NAs
[ "Ops", "do", "not", "make", "sense", "on", "categoricals", "except", "EQ", "/", "NE", ";", "flip", "such", "ops", "to", "NAs" ]
train
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/rapids/ast/prims/operators/AstBinOp.java#L205-L217
AlmogBaku/IntlPhoneInput
intlphoneinput/src/main/java/net/rimoto/intlphoneinput/CountriesFetcher.java
CountriesFetcher.getCountries
public static CountryList getCountries(Context context) { """ Import CountryList from RAW resource @param context Context @return CountryList """ if (mCountries != null) { return mCountries; } mCountries = new CountryList(); try { JSONArray countries ...
java
public static CountryList getCountries(Context context) { if (mCountries != null) { return mCountries; } mCountries = new CountryList(); try { JSONArray countries = new JSONArray(getJsonFromRaw(context, R.raw.countries)); for (int i = 0; i < countries....
[ "public", "static", "CountryList", "getCountries", "(", "Context", "context", ")", "{", "if", "(", "mCountries", "!=", "null", ")", "{", "return", "mCountries", ";", "}", "mCountries", "=", "new", "CountryList", "(", ")", ";", "try", "{", "JSONArray", "cou...
Import CountryList from RAW resource @param context Context @return CountryList
[ "Import", "CountryList", "from", "RAW", "resource" ]
train
https://github.com/AlmogBaku/IntlPhoneInput/blob/ac7313a2d1683feb4d535d5dbee6676b53879059/intlphoneinput/src/main/java/net/rimoto/intlphoneinput/CountriesFetcher.java#L46-L65
codegist/crest
core/src/main/java/org/codegist/crest/CRestBuilder.java
CRestBuilder.setProperties
public CRestBuilder setProperties(Map<String, Object> crestProperties) { """ <p>Sets all given properties to the {@link org.codegist.crest.CRestConfig} that will be passed to all <b>CRest</b> components.</p> <p>Note that these properties can be used to override defaut <b>CRest</b>'s MethodConfig and ParamConfig v...
java
public CRestBuilder setProperties(Map<String, Object> crestProperties) { this.crestProperties.clear(); return addProperties(crestProperties); }
[ "public", "CRestBuilder", "setProperties", "(", "Map", "<", "String", ",", "Object", ">", "crestProperties", ")", "{", "this", ".", "crestProperties", ".", "clear", "(", ")", ";", "return", "addProperties", "(", "crestProperties", ")", ";", "}" ]
<p>Sets all given properties to the {@link org.codegist.crest.CRestConfig} that will be passed to all <b>CRest</b> components.</p> <p>Note that these properties can be used to override defaut <b>CRest</b>'s MethodConfig and ParamConfig values when none are provided through annotations.</p> @param crestProperties proper...
[ "<p", ">", "Sets", "all", "given", "properties", "to", "the", "{" ]
train
https://github.com/codegist/crest/blob/e99ba7728b27d2ddb2c247261350f1b6fa7a6698/core/src/main/java/org/codegist/crest/CRestBuilder.java#L379-L382
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/crypto/totp/TOTPBuilder.java
TOTPBuilder.computeHmacSha
private byte[] computeHmacSha(byte[] keyBytes, byte[] text) { """ Returns the HMAC-SHA hash with {@code keyBytes} as the key, and {@code text} as the message. @param keyBytes the bytes to use for the HMAC key @param text the message or text to be authenticated @return the HMAC-SHA hash with {@code keyByt...
java
private byte[] computeHmacSha(byte[] keyBytes, byte[] text) { try { Mac hmac = Mac.getInstance("HmacSHA512"); SecretKeySpec macKey = new SecretKeySpec(keyBytes, "RAW"); hmac.init(macKey); return hmac.doFinal(text); } catch (GeneralSecurityException gse) { ...
[ "private", "byte", "[", "]", "computeHmacSha", "(", "byte", "[", "]", "keyBytes", ",", "byte", "[", "]", "text", ")", "{", "try", "{", "Mac", "hmac", "=", "Mac", ".", "getInstance", "(", "\"HmacSHA512\"", ")", ";", "SecretKeySpec", "macKey", "=", "new"...
Returns the HMAC-SHA hash with {@code keyBytes} as the key, and {@code text} as the message. @param keyBytes the bytes to use for the HMAC key @param text the message or text to be authenticated @return the HMAC-SHA hash with {@code keyBytes} as the key, and {@code text} as the message.
[ "Returns", "the", "HMAC", "-", "SHA", "hash", "with", "{", "@code", "keyBytes", "}", "as", "the", "key", "and", "{", "@code", "text", "}", "as", "the", "message", "." ]
train
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/crypto/totp/TOTPBuilder.java#L243-L252
lucasr/probe
library/src/main/java/org/lucasr/probe/Interceptor.java
Interceptor.invokeOnDraw
protected final void invokeOnDraw(View view, Canvas canvas) { """ Performs an {@link View#onDraw(Canvas)} call on the given {@link View}. """ final ViewProxy proxy = (ViewProxy) view; proxy.invokeOnDraw(canvas); }
java
protected final void invokeOnDraw(View view, Canvas canvas) { final ViewProxy proxy = (ViewProxy) view; proxy.invokeOnDraw(canvas); }
[ "protected", "final", "void", "invokeOnDraw", "(", "View", "view", ",", "Canvas", "canvas", ")", "{", "final", "ViewProxy", "proxy", "=", "(", "ViewProxy", ")", "view", ";", "proxy", ".", "invokeOnDraw", "(", "canvas", ")", ";", "}" ]
Performs an {@link View#onDraw(Canvas)} call on the given {@link View}.
[ "Performs", "an", "{" ]
train
https://github.com/lucasr/probe/blob/cd15cc04383a1bf85de2f4c345d2018415b9ddc9/library/src/main/java/org/lucasr/probe/Interceptor.java#L107-L110
sebastiangraf/jSCSI
bundles/commons/src/main/java/org/jscsi/parser/datasegment/AbstractDataSegment.java
AbstractDataSegment.resizeBuffer
protected void resizeBuffer (final int additionalLength, final boolean copyData) { """ This method resizes the data buffer, if necessary. A resizing is not needed, when the <code>neededLength</code> is greater than the capacity of allocated data buffer. The flag <code>copyData</code> indicates, if the old buffer...
java
protected void resizeBuffer (final int additionalLength, final boolean copyData) { if (additionalLength < 0) { throw new IllegalArgumentException("The length must be greater or equal than 0."); } dataBuffer.position(length); // reallocate a bigger dataBuffer, if needed if (length + ad...
[ "protected", "void", "resizeBuffer", "(", "final", "int", "additionalLength", ",", "final", "boolean", "copyData", ")", "{", "if", "(", "additionalLength", "<", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"The length must be greater or equal than...
This method resizes the data buffer, if necessary. A resizing is not needed, when the <code>neededLength</code> is greater than the capacity of allocated data buffer. The flag <code>copyData</code> indicates, if the old buffer has to be copied into the new bigger data buffer. @param additionalLength The length, which ...
[ "This", "method", "resizes", "the", "data", "buffer", "if", "necessary", ".", "A", "resizing", "is", "not", "needed", "when", "the", "<code", ">", "neededLength<", "/", "code", ">", "is", "greater", "than", "the", "capacity", "of", "allocated", "data", "bu...
train
https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/datasegment/AbstractDataSegment.java#L131-L154
vipshop/vjtools
vjkit/src/main/java/com/vip/vjtools/vjkit/security/CryptoUtil.java
CryptoUtil.isMacValid
public static boolean isMacValid(byte[] expected, byte[] input, byte[] key) { """ 校验HMAC-SHA1签名是否正确. @param expected 已存在的签名 @param input 原始输入字符串 @param key 密钥 """ byte[] actual = hmacSha1(input, key); return Arrays.equals(expected, actual); }
java
public static boolean isMacValid(byte[] expected, byte[] input, byte[] key) { byte[] actual = hmacSha1(input, key); return Arrays.equals(expected, actual); }
[ "public", "static", "boolean", "isMacValid", "(", "byte", "[", "]", "expected", ",", "byte", "[", "]", "input", ",", "byte", "[", "]", "key", ")", "{", "byte", "[", "]", "actual", "=", "hmacSha1", "(", "input", ",", "key", ")", ";", "return", "Arra...
校验HMAC-SHA1签名是否正确. @param expected 已存在的签名 @param input 原始输入字符串 @param key 密钥
[ "校验HMAC", "-", "SHA1签名是否正确", "." ]
train
https://github.com/vipshop/vjtools/blob/60c743da35913d72f37f2d79afa90ad2bf73cb89/vjkit/src/main/java/com/vip/vjtools/vjkit/security/CryptoUtil.java#L60-L63
alkacon/opencms-core
src/org/opencms/ui/components/fileselect/CmsResourceSelectDialog.java
CmsResourceSelectDialog.updateRoot
protected void updateRoot(CmsObject rootCms, CmsResource siteRootResource) { """ Updates the current site root resource.<p> @param rootCms the CMS context @param siteRootResource the resource corresponding to a site root """ m_root = siteRootResource; m_currentCms = rootCms; update...
java
protected void updateRoot(CmsObject rootCms, CmsResource siteRootResource) { m_root = siteRootResource; m_currentCms = rootCms; updateView(); }
[ "protected", "void", "updateRoot", "(", "CmsObject", "rootCms", ",", "CmsResource", "siteRootResource", ")", "{", "m_root", "=", "siteRootResource", ";", "m_currentCms", "=", "rootCms", ";", "updateView", "(", ")", ";", "}" ]
Updates the current site root resource.<p> @param rootCms the CMS context @param siteRootResource the resource corresponding to a site root
[ "Updates", "the", "current", "site", "root", "resource", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/fileselect/CmsResourceSelectDialog.java#L413-L418
fozziethebeat/S-Space
src/main/java/edu/ucla/sspace/rri/ReflectiveRandomIndexing.java
ReflectiveRandomIndexing.processIntDocument
private void processIntDocument(IntegerVector docVector, int[] document) { """ Processes the compressed version of a document where each integer indicates that token's index, adding the document's vector to the reflective semantic vector each time a term occurs in the document. @param docVector the vector of ...
java
private void processIntDocument(IntegerVector docVector, int[] document) { // Make one pass through the document to build the document vector. for (int termIndex : document) { IntegerVector reflectiveVector = termToReflectiveSemantics.get(indexToTerm[termIndex]); ...
[ "private", "void", "processIntDocument", "(", "IntegerVector", "docVector", ",", "int", "[", "]", "document", ")", "{", "// Make one pass through the document to build the document vector.", "for", "(", "int", "termIndex", ":", "document", ")", "{", "IntegerVector", "re...
Processes the compressed version of a document where each integer indicates that token's index, adding the document's vector to the reflective semantic vector each time a term occurs in the document. @param docVector the vector of the document that is being processed @param document the document to be processed where ...
[ "Processes", "the", "compressed", "version", "of", "a", "document", "where", "each", "integer", "indicates", "that", "token", "s", "index", "adding", "the", "document", "s", "vector", "to", "the", "reflective", "semantic", "vector", "each", "time", "a", "term"...
train
https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/rri/ReflectiveRandomIndexing.java#L538-L550
gallandarakhneorg/afc
advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/AbstractBusPrimitive.java
AbstractBusPrimitive.addListener
protected final <T extends EventListener> void addListener(Class<T> listenerType, T listener) { """ Add a listener. @param <T> is the type of listener to add. @param listenerType is the type of listener to add. @param listener is the new listener. """ if (this.listeners == null) { this.listeners = ne...
java
protected final <T extends EventListener> void addListener(Class<T> listenerType, T listener) { if (this.listeners == null) { this.listeners = new ListenerCollection<>(); } this.listeners.add(listenerType, listener); }
[ "protected", "final", "<", "T", "extends", "EventListener", ">", "void", "addListener", "(", "Class", "<", "T", ">", "listenerType", ",", "T", "listener", ")", "{", "if", "(", "this", ".", "listeners", "==", "null", ")", "{", "this", ".", "listeners", ...
Add a listener. @param <T> is the type of listener to add. @param listenerType is the type of listener to add. @param listener is the new listener.
[ "Add", "a", "listener", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/AbstractBusPrimitive.java#L149-L154
outbrain/ob1k
ob1k-db/src/main/java/com/outbrain/ob1k/db/experimental/MySqlConnectionPoolBuilder.java
MySqlConnectionPoolBuilder.newBuilder
public static MySqlConnectionPoolBuilder newBuilder(final String connectionString, final String username) { """ Warning - Use only when the connection string is in host:port format without schema and other parameter. example: mydb.company.com:3308 @param connectionString host:port @param username user...
java
public static MySqlConnectionPoolBuilder newBuilder(final String connectionString, final String username) { final String[] arr = connectionString.split(":"); final String host = arr[0]; final int port = Integer.parseInt(arr[1]); return newBuilder(host, port, username); }
[ "public", "static", "MySqlConnectionPoolBuilder", "newBuilder", "(", "final", "String", "connectionString", ",", "final", "String", "username", ")", "{", "final", "String", "[", "]", "arr", "=", "connectionString", ".", "split", "(", "\":\"", ")", ";", "final", ...
Warning - Use only when the connection string is in host:port format without schema and other parameter. example: mydb.company.com:3308 @param connectionString host:port @param username user name for login.
[ "Warning", "-", "Use", "only", "when", "the", "connection", "string", "is", "in", "host", ":", "port", "format", "without", "schema", "and", "other", "parameter", ".", "example", ":", "mydb", ".", "company", ".", "com", ":", "3308" ]
train
https://github.com/outbrain/ob1k/blob/9e43ab39230c5787065053da0f766d822d0fe4e7/ob1k-db/src/main/java/com/outbrain/ob1k/db/experimental/MySqlConnectionPoolBuilder.java#L66-L71
grails/grails-core
grails-core/src/main/groovy/org/grails/core/AbstractGrailsClass.java
AbstractGrailsClass.getStaticPropertyValue
public <T> T getStaticPropertyValue(String propName, Class<T> type) { """ Get the value of the named static property. @param propName @param type @return The property value or null """ return ClassPropertyFetcher.getStaticPropertyValue(getClazz(), propName, type); }
java
public <T> T getStaticPropertyValue(String propName, Class<T> type) { return ClassPropertyFetcher.getStaticPropertyValue(getClazz(), propName, type); }
[ "public", "<", "T", ">", "T", "getStaticPropertyValue", "(", "String", "propName", ",", "Class", "<", "T", ">", "type", ")", "{", "return", "ClassPropertyFetcher", ".", "getStaticPropertyValue", "(", "getClazz", "(", ")", ",", "propName", ",", "type", ")", ...
Get the value of the named static property. @param propName @param type @return The property value or null
[ "Get", "the", "value", "of", "the", "named", "static", "property", "." ]
train
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/core/AbstractGrailsClass.java#L238-L240
JoeKerouac/utils
src/main/java/com/joe/utils/common/IOUtils.java
IOUtils.saveAsFile
public static void saveAsFile(byte[] data, String addr) throws IOException { """ 保存数据到本地 @param data 数据 @param addr 保存本地的路径,包含文件名,例如D://a.txt @throws IOException IO异常 """ log.debug("将字节数据保存到本地文件"); File file = new File(addr); if (!file.exists()) { if (!file.getParentFil...
java
public static void saveAsFile(byte[] data, String addr) throws IOException { log.debug("将字节数据保存到本地文件"); File file = new File(addr); if (!file.exists()) { if (!file.getParentFile().mkdirs()) { log.error("创建目录{}失败", addr); } } log.debug("保存路径...
[ "public", "static", "void", "saveAsFile", "(", "byte", "[", "]", "data", ",", "String", "addr", ")", "throws", "IOException", "{", "log", ".", "debug", "(", "\"将字节数据保存到本地文件\");", "", "", "File", "file", "=", "new", "File", "(", "addr", ")", ";", "if", ...
保存数据到本地 @param data 数据 @param addr 保存本地的路径,包含文件名,例如D://a.txt @throws IOException IO异常
[ "保存数据到本地" ]
train
https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/common/IOUtils.java#L63-L77
bmwcarit/joynr
java/javaapi/src/main/java/io/joynr/dispatcher/rpc/ReflectionUtils.java
ReflectionUtils.areMethodNameAndParameterTypesEqual
private static boolean areMethodNameAndParameterTypesEqual(Method methodA, Method methodB) { """ Compares to methods for equality based on name and parameter types. """ if (!methodA.getName().equals(methodB.getName())) { return false; } Class<?>[] methodAParameterTypes = met...
java
private static boolean areMethodNameAndParameterTypesEqual(Method methodA, Method methodB) { if (!methodA.getName().equals(methodB.getName())) { return false; } Class<?>[] methodAParameterTypes = methodA.getParameterTypes(); Class<?>[] methodBParameterTypes = methodB.getParam...
[ "private", "static", "boolean", "areMethodNameAndParameterTypesEqual", "(", "Method", "methodA", ",", "Method", "methodB", ")", "{", "if", "(", "!", "methodA", ".", "getName", "(", ")", ".", "equals", "(", "methodB", ".", "getName", "(", ")", ")", ")", "{"...
Compares to methods for equality based on name and parameter types.
[ "Compares", "to", "methods", "for", "equality", "based", "on", "name", "and", "parameter", "types", "." ]
train
https://github.com/bmwcarit/joynr/blob/b7a92bad1cf2f093de080facd2c803560f4c6c26/java/javaapi/src/main/java/io/joynr/dispatcher/rpc/ReflectionUtils.java#L174-L190
spring-projects/spring-boot
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONArray.java
JSONArray.optDouble
public double optDouble(int index, double fallback) { """ Returns the value at {@code index} if it exists and is a double or can be coerced to a double. Returns {@code fallback} otherwise. @param index the index to get the value from @param fallback the fallback value @return the value at {@code index} of {@co...
java
public double optDouble(int index, double fallback) { Object object = opt(index); Double result = JSON.toDouble(object); return result != null ? result : fallback; }
[ "public", "double", "optDouble", "(", "int", "index", ",", "double", "fallback", ")", "{", "Object", "object", "=", "opt", "(", "index", ")", ";", "Double", "result", "=", "JSON", ".", "toDouble", "(", "object", ")", ";", "return", "result", "!=", "nul...
Returns the value at {@code index} if it exists and is a double or can be coerced to a double. Returns {@code fallback} otherwise. @param index the index to get the value from @param fallback the fallback value @return the value at {@code index} of {@code fallback}
[ "Returns", "the", "value", "at", "{" ]
train
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONArray.java#L396-L400
jenkinsci/jenkins
core/src/main/java/hudson/model/ParameterValue.java
ParameterValue.buildEnvVars
@Deprecated public void buildEnvVars(AbstractBuild<?,?> build, Map<String,String> env) { """ Adds environmental variables for the builds to the given map. <p> This provides a means for a parameter to pass the parameter values to the build to be performed. <p> When this method is invoked, the map alrea...
java
@Deprecated public void buildEnvVars(AbstractBuild<?,?> build, Map<String,String> env) { if (env instanceof EnvVars) { if (Util.isOverridden(ParameterValue.class, getClass(), "buildEnvironment", Run.class, EnvVars.class)) { // if the subtype already derives buildEnvironment, then...
[ "@", "Deprecated", "public", "void", "buildEnvVars", "(", "AbstractBuild", "<", "?", ",", "?", ">", "build", ",", "Map", "<", "String", ",", "String", ">", "env", ")", "{", "if", "(", "env", "instanceof", "EnvVars", ")", "{", "if", "(", "Util", ".", ...
Adds environmental variables for the builds to the given map. <p> This provides a means for a parameter to pass the parameter values to the build to be performed. <p> When this method is invoked, the map already contains the current "planned export" list. The implementation is expected to add more values to this map ...
[ "Adds", "environmental", "variables", "for", "the", "builds", "to", "the", "given", "map", "." ]
train
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/ParameterValue.java#L151-L162
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowController.java
FlowController.create
public synchronized void create( HttpServletRequest request, HttpServletResponse response, ServletContext servletContext ) { """ Initialize after object creation. This is a framework-invoked method; it should not normally be called directly...
java
public synchronized void create( HttpServletRequest request, HttpServletResponse response, ServletContext servletContext ) { PerRequestState prevState = setPerRequestState( new PerRequestState( request, response, null ) ); tr...
[ "public", "synchronized", "void", "create", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ",", "ServletContext", "servletContext", ")", "{", "PerRequestState", "prevState", "=", "setPerRequestState", "(", "new", "PerRequestState", "(", "r...
Initialize after object creation. This is a framework-invoked method; it should not normally be called directly.
[ "Initialize", "after", "object", "creation", ".", "This", "is", "a", "framework", "-", "invoked", "method", ";", "it", "should", "not", "normally", "be", "called", "directly", "." ]
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowController.java#L561-L602
querydsl/querydsl
querydsl-core/src/main/java/com/querydsl/core/types/ExpressionUtils.java
ExpressionUtils.predicateTemplate
@Deprecated public static PredicateTemplate predicateTemplate(String template, ImmutableList<?> args) { """ Create a new Template expression @deprecated Use {@link #predicateTemplate(String, List)} instead. @param template template @param args template parameters @return template expression """ ...
java
@Deprecated public static PredicateTemplate predicateTemplate(String template, ImmutableList<?> args) { return predicateTemplate(TemplateFactory.DEFAULT.create(template), args); }
[ "@", "Deprecated", "public", "static", "PredicateTemplate", "predicateTemplate", "(", "String", "template", ",", "ImmutableList", "<", "?", ">", "args", ")", "{", "return", "predicateTemplate", "(", "TemplateFactory", ".", "DEFAULT", ".", "create", "(", "template"...
Create a new Template expression @deprecated Use {@link #predicateTemplate(String, List)} instead. @param template template @param args template parameters @return template expression
[ "Create", "a", "new", "Template", "expression" ]
train
https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/ExpressionUtils.java#L153-L156
calimero-project/calimero-core
src/tuwien/auto/calimero/dptxlator/TranslatorTypes.java
TranslatorTypes.createTranslator
public static DPTXlator createTranslator(final int mainNumber, final int subNumber, final byte... data) throws KNXException { """ Creates a DPT translator for the given datapoint type main/sub number. @param mainNumber datapoint type main number, 0 &lt; mainNumber @param subNumber datapoint type sub number s...
java
public static DPTXlator createTranslator(final int mainNumber, final int subNumber, final byte... data) throws KNXException { final MainType type = map.get(mainNumber); if (type == null) throw new KNXException("no DPT translator available for main number " + mainNumber); final boolean withSub = subNumber !...
[ "public", "static", "DPTXlator", "createTranslator", "(", "final", "int", "mainNumber", ",", "final", "int", "subNumber", ",", "final", "byte", "...", "data", ")", "throws", "KNXException", "{", "final", "MainType", "type", "=", "map", ".", "get", "(", "main...
Creates a DPT translator for the given datapoint type main/sub number. @param mainNumber datapoint type main number, 0 &lt; mainNumber @param subNumber datapoint type sub number selecting a particular kind of value translation; use 0 to request any type ID of that translator (in that case, appending the physical unit ...
[ "Creates", "a", "DPT", "translator", "for", "the", "given", "datapoint", "type", "main", "/", "sub", "number", "." ]
train
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/dptxlator/TranslatorTypes.java#L588-L603
powermock/powermock
powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java
WhiteboxImpl.getFieldsAnnotatedWith
@SuppressWarnings("unchecked") public static Set<Field> getFieldsAnnotatedWith(Object object, Class<? extends Annotation> annotation, Class<? extends Annotation>... additionalAnnotations) { """ Get all fields annotated with a particular annotation. This metho...
java
@SuppressWarnings("unchecked") public static Set<Field> getFieldsAnnotatedWith(Object object, Class<? extends Annotation> annotation, Class<? extends Annotation>... additionalAnnotations) { Class<? extends Annotation>[] annotations = null; if (addi...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "Set", "<", "Field", ">", "getFieldsAnnotatedWith", "(", "Object", "object", ",", "Class", "<", "?", "extends", "Annotation", ">", "annotation", ",", "Class", "<", "?", "extends", "Annotat...
Get all fields annotated with a particular annotation. This method traverses the class hierarchy when checking for the annotation. @param object The object to look for annotations. Note that if're you're passing an object only instance fields are checked, passing a class will only check static fields. @...
[ "Get", "all", "fields", "annotated", "with", "a", "particular", "annotation", ".", "This", "method", "traverses", "the", "class", "hierarchy", "when", "checking", "for", "the", "annotation", "." ]
train
https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java#L2147-L2159
DDTH/ddth-dao
ddth-dao-core/src/main/java/com/github/ddth/dao/utils/BoUtils.java
BoUtils.fromJson
public static <T extends BaseBo> T fromJson(String json, Class<T> clazz) { """ De-serialize a BO from JSON string. @param json the JSON string obtained from {@link #toJson(BaseBo)} @param clazz @return """ return fromJson(json, clazz, null); }
java
public static <T extends BaseBo> T fromJson(String json, Class<T> clazz) { return fromJson(json, clazz, null); }
[ "public", "static", "<", "T", "extends", "BaseBo", ">", "T", "fromJson", "(", "String", "json", ",", "Class", "<", "T", ">", "clazz", ")", "{", "return", "fromJson", "(", "json", ",", "clazz", ",", "null", ")", ";", "}" ]
De-serialize a BO from JSON string. @param json the JSON string obtained from {@link #toJson(BaseBo)} @param clazz @return
[ "De", "-", "serialize", "a", "BO", "from", "JSON", "string", "." ]
train
https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/utils/BoUtils.java#L107-L109
Wikidata/Wikidata-Toolkit
wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/TermStatementUpdate.java
TermStatementUpdate.processAliases
protected void processAliases(List<MonolingualTextValue> addAliases, List<MonolingualTextValue> deleteAliases) { """ Processes changes on aliases, updating the planned state of the item. @param addAliases aliases that should be added to the document @param deleteAliases aliases that should be removed from th...
java
protected void processAliases(List<MonolingualTextValue> addAliases, List<MonolingualTextValue> deleteAliases) { for(MonolingualTextValue val : addAliases) { addAlias(val); } for(MonolingualTextValue val : deleteAliases) { deleteAlias(val); } }
[ "protected", "void", "processAliases", "(", "List", "<", "MonolingualTextValue", ">", "addAliases", ",", "List", "<", "MonolingualTextValue", ">", "deleteAliases", ")", "{", "for", "(", "MonolingualTextValue", "val", ":", "addAliases", ")", "{", "addAlias", "(", ...
Processes changes on aliases, updating the planned state of the item. @param addAliases aliases that should be added to the document @param deleteAliases aliases that should be removed from the document
[ "Processes", "changes", "on", "aliases", "updating", "the", "planned", "state", "of", "the", "item", "." ]
train
https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/TermStatementUpdate.java#L170-L177