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
powermock/powermock
powermock-api/powermock-api-mockito2/src/main/java/org/powermock/api/mockito/PowerMockito.java
PowerMockito.verifyPrivate
public static PrivateMethodVerification verifyPrivate(Class<?> clazz, VerificationMode verificationMode) { """ Verify a private method invocation for a class with a given verification mode. @see Mockito#verify(Object) """ return verifyPrivate((Object) clazz, verificationMode); }
java
public static PrivateMethodVerification verifyPrivate(Class<?> clazz, VerificationMode verificationMode) { return verifyPrivate((Object) clazz, verificationMode); }
[ "public", "static", "PrivateMethodVerification", "verifyPrivate", "(", "Class", "<", "?", ">", "clazz", ",", "VerificationMode", "verificationMode", ")", "{", "return", "verifyPrivate", "(", "(", "Object", ")", "clazz", ",", "verificationMode", ")", ";", "}" ]
Verify a private method invocation for a class with a given verification mode. @see Mockito#verify(Object)
[ "Verify", "a", "private", "method", "invocation", "for", "a", "class", "with", "a", "given", "verification", "mode", "." ]
train
https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-mockito2/src/main/java/org/powermock/api/mockito/PowerMockito.java#L301-L303
nohana/Amalgam
amalgam/src/main/java/com/amalgam/view/ViewUtils.java
ViewUtils.dipToPixel
public static int dipToPixel(Resources resources, int dip) { """ Convert the dips to pixels, based on density scale. @param resources application resources. @param dip to be converted value. @return converted value(px). """ final float scale = resources.getDisplayMetrics().density; // add ...
java
public static int dipToPixel(Resources resources, int dip) { final float scale = resources.getDisplayMetrics().density; // add 0.5f to round the figure up to the nearest whole number return (int) (dip * scale + 0.5f); }
[ "public", "static", "int", "dipToPixel", "(", "Resources", "resources", ",", "int", "dip", ")", "{", "final", "float", "scale", "=", "resources", ".", "getDisplayMetrics", "(", ")", ".", "density", ";", "// add 0.5f to round the figure up to the nearest whole number",...
Convert the dips to pixels, based on density scale. @param resources application resources. @param dip to be converted value. @return converted value(px).
[ "Convert", "the", "dips", "to", "pixels", "based", "on", "density", "scale", "." ]
train
https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/view/ViewUtils.java#L53-L57
jferard/fastods
fastods/src/main/java/com/github/jferard/fastods/TableRow.java
TableRow.setRowsSpanned
public void setRowsSpanned(final int rowIndex, final int n) throws IOException { """ Add a span across rows @param rowIndex the index of the first row @param n the number of rows in the span @throws IOException if the cells can't be merged """ if (n <= 1) return; final TableCell...
java
public void setRowsSpanned(final int rowIndex, final int n) throws IOException { if (n <= 1) return; final TableCell firstCell = this.getOrCreateCell(rowIndex); if (firstCell.isCovered()) return; this.parent.setRowsSpanned(this.rowIndex, rowIndex, n); }
[ "public", "void", "setRowsSpanned", "(", "final", "int", "rowIndex", ",", "final", "int", "n", ")", "throws", "IOException", "{", "if", "(", "n", "<=", "1", ")", "return", ";", "final", "TableCell", "firstCell", "=", "this", ".", "getOrCreateCell", "(", ...
Add a span across rows @param rowIndex the index of the first row @param n the number of rows in the span @throws IOException if the cells can't be merged
[ "Add", "a", "span", "across", "rows" ]
train
https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/TableRow.java#L216-L223
akamai/AkamaiOPEN-edgegrid-java
edgerc-reader/src/main/java/com/akamai/edgegrid/signer/EdgeRcClientCredentialProvider.java
EdgeRcClientCredentialProvider.fromEdgeRc
public static EdgeRcClientCredentialProvider fromEdgeRc(File file, String section) throws ConfigurationException, IOException { """ Loads an EdgeRc configuration file and returns an {@link EdgeRcClientCredentialProvider} to read {@link ClientCredential}s from it. @param file a {@link File} pointing...
java
public static EdgeRcClientCredentialProvider fromEdgeRc(File file, String section) throws ConfigurationException, IOException { Objects.requireNonNull(file, "file cannot be null"); return fromEdgeRc(new FileReader(file), section); }
[ "public", "static", "EdgeRcClientCredentialProvider", "fromEdgeRc", "(", "File", "file", ",", "String", "section", ")", "throws", "ConfigurationException", ",", "IOException", "{", "Objects", ".", "requireNonNull", "(", "file", ",", "\"file cannot be null\"", ")", ";"...
Loads an EdgeRc configuration file and returns an {@link EdgeRcClientCredentialProvider} to read {@link ClientCredential}s from it. @param file a {@link File} pointing to an EdgeRc file @param section a config section ({@code null} for the default section) @return a {@link EdgeRcClientCredentialProvider} @throws Confi...
[ "Loads", "an", "EdgeRc", "configuration", "file", "and", "returns", "an", "{", "@link", "EdgeRcClientCredentialProvider", "}", "to", "read", "{", "@link", "ClientCredential", "}", "s", "from", "it", "." ]
train
https://github.com/akamai/AkamaiOPEN-edgegrid-java/blob/29aa39f0f70f62503e6a434c4470ee25cb640f58/edgerc-reader/src/main/java/com/akamai/edgegrid/signer/EdgeRcClientCredentialProvider.java#L62-L66
OpenLiberty/open-liberty
dev/wlp.lib.extract/src/wlp/lib/extract/SelfExtractRun.java
SelfExtractRun.createTempDirectory
private static String createTempDirectory(String baseDir, String fileStem) { """ Generate unique directory name of form: basedir/fileStem<time-in-nanos> @param baseDir @param fileStem @return unique dir name """ Long nano = new Long(System.nanoTime()); return baseDir + File.separator + fi...
java
private static String createTempDirectory(String baseDir, String fileStem) { Long nano = new Long(System.nanoTime()); return baseDir + File.separator + fileStem + nano; }
[ "private", "static", "String", "createTempDirectory", "(", "String", "baseDir", ",", "String", "fileStem", ")", "{", "Long", "nano", "=", "new", "Long", "(", "System", ".", "nanoTime", "(", ")", ")", ";", "return", "baseDir", "+", "File", ".", "separator",...
Generate unique directory name of form: basedir/fileStem<time-in-nanos> @param baseDir @param fileStem @return unique dir name
[ "Generate", "unique", "directory", "name", "of", "form", ":", "basedir", "/", "fileStem<time", "-", "in", "-", "nanos", ">" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/wlp.lib.extract/src/wlp/lib/extract/SelfExtractRun.java#L120-L123
baidubce/bce-sdk-java
src/main/java/com/baidubce/services/lss/LssClient.java
LssClient.deletePreset
public DeletePresetResponse deletePreset(DeletePresetRequest request) { """ Delete your live presets by live preset name. @param request The request object containing all parameters for deleting live preset. @return the response """ checkNotNull(request, "The parameter request should NOT be null.")...
java
public DeletePresetResponse deletePreset(DeletePresetRequest request) { checkNotNull(request, "The parameter request should NOT be null."); checkStringNotEmpty(request.getName(), "The parameter name should NOT be null or empty string."); InternalRequest internalRequest = createRequest(HttpMethod...
[ "public", "DeletePresetResponse", "deletePreset", "(", "DeletePresetRequest", "request", ")", "{", "checkNotNull", "(", "request", ",", "\"The parameter request should NOT be null.\"", ")", ";", "checkStringNotEmpty", "(", "request", ".", "getName", "(", ")", ",", "\"Th...
Delete your live presets by live preset name. @param request The request object containing all parameters for deleting live preset. @return the response
[ "Delete", "your", "live", "presets", "by", "live", "preset", "name", "." ]
train
https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/lss/LssClient.java#L444-L450
cloudant/java-cloudant
cloudant-client/src/main/java/com/cloudant/client/api/Database.java
Database.saveAttachment
public com.cloudant.client.api.model.Response saveAttachment(InputStream in, String name, String contentType) { """ Creates an attachment from the specified InputStream and a new document with a generated document ID. <P>Example usage:</P> <pre> ...
java
public com.cloudant.client.api.model.Response saveAttachment(InputStream in, String name, String contentType) { Response couchDbResponse = db.saveAttachment(in, name, contentType); com.cloudant.client.api.model.Response response = new com....
[ "public", "com", ".", "cloudant", ".", "client", ".", "api", ".", "model", ".", "Response", "saveAttachment", "(", "InputStream", "in", ",", "String", "name", ",", "String", "contentType", ")", "{", "Response", "couchDbResponse", "=", "db", ".", "saveAttachm...
Creates an attachment from the specified InputStream and a new document with a generated document ID. <P>Example usage:</P> <pre> {@code byte[] bytesToDB = "binary data".getBytes(); ByteArrayInputStream bytesIn = new ByteArrayInputStream(bytesToDB); Response response = db.saveAttachment(bytesIn, "foo.txt", "text/plain"...
[ "Creates", "an", "attachment", "from", "the", "specified", "InputStream", "and", "a", "new", "document", "with", "a", "generated", "document", "ID", ".", "<P", ">", "Example", "usage", ":", "<", "/", "P", ">", "<pre", ">", "{", "@code", "byte", "[]", "...
train
https://github.com/cloudant/java-cloudant/blob/42c438654945361bded2cc0827afc046d535b31b/cloudant-client/src/main/java/com/cloudant/client/api/Database.java#L1243-L1249
jboss/jboss-jstl-api_spec
src/main/java/org/apache/taglibs/standard/functions/Functions.java
Functions.substringBefore
public static String substringBefore(String input, String substring) { """ Returns a subset of a string immediately before the first occurrence of a specific substring. <p>If the substring is empty, it matches the beginning of the input string and an empty string is returned. If the substring does not occur, an ...
java
public static String substringBefore(String input, String substring) { int index = input.indexOf(substring); if (index == -1) { return ""; } else { return input.substring(0, index); } }
[ "public", "static", "String", "substringBefore", "(", "String", "input", ",", "String", "substring", ")", "{", "int", "index", "=", "input", ".", "indexOf", "(", "substring", ")", ";", "if", "(", "index", "==", "-", "1", ")", "{", "return", "\"\"", ";"...
Returns a subset of a string immediately before the first occurrence of a specific substring. <p>If the substring is empty, it matches the beginning of the input string and an empty string is returned. If the substring does not occur, an empty string is returned. @param input the input string on which the substrin...
[ "Returns", "a", "subset", "of", "a", "string", "immediately", "before", "the", "first", "occurrence", "of", "a", "specific", "substring", ".", "<p", ">", "If", "the", "substring", "is", "empty", "it", "matches", "the", "beginning", "of", "the", "input", "s...
train
https://github.com/jboss/jboss-jstl-api_spec/blob/4ad412ae5be1ae606b8d33c188cb3d98bfcbe84c/src/main/java/org/apache/taglibs/standard/functions/Functions.java#L192-L199
Azure/azure-sdk-for-java
cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java
ModelsImpl.updateClosedListEntityRoleWithServiceResponseAsync
public Observable<ServiceResponse<OperationStatus>> updateClosedListEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId, UpdateClosedListEntityRoleOptionalParameter updateClosedListEntityRoleOptionalParameter) { """ Update an entity role for a given entity. @param appId T...
java
public Observable<ServiceResponse<OperationStatus>> updateClosedListEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId, UpdateClosedListEntityRoleOptionalParameter updateClosedListEntityRoleOptionalParameter) { if (this.client.endpoint() == null) { throw new ...
[ "public", "Observable", "<", "ServiceResponse", "<", "OperationStatus", ">", ">", "updateClosedListEntityRoleWithServiceResponseAsync", "(", "UUID", "appId", ",", "String", "versionId", ",", "UUID", "entityId", ",", "UUID", "roleId", ",", "UpdateClosedListEntityRoleOption...
Update an entity role for a given entity. @param appId The application ID. @param versionId The version ID. @param entityId The entity ID. @param roleId The entity role ID. @param updateClosedListEntityRoleOptionalParameter the object representing the optional parameters to be set before calling this API @throws Illeg...
[ "Update", "an", "entity", "role", "for", "a", "given", "entity", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L11699-L11718
TakahikoKawasaki/nv-websocket-client
src/main/java/com/neovisionaries/ws/client/WebSocketExtension.java
WebSocketExtension.setParameter
public WebSocketExtension setParameter(String key, String value) { """ Set a value to the specified parameter. @param key The name of the parameter. @param value The value of the parameter. If not {@code null}, it must be a valid token. Note that <a href="http://tools.ietf.org/html/rfc6455" >RFC 6455</a>...
java
public WebSocketExtension setParameter(String key, String value) { // Check the validity of the key. if (Token.isValid(key) == false) { // The key is not a valid token. throw new IllegalArgumentException("'key' is not a valid token."); } // If the val...
[ "public", "WebSocketExtension", "setParameter", "(", "String", "key", ",", "String", "value", ")", "{", "// Check the validity of the key.", "if", "(", "Token", ".", "isValid", "(", "key", ")", "==", "false", ")", "{", "// The key is not a valid token.", "throw", ...
Set a value to the specified parameter. @param key The name of the parameter. @param value The value of the parameter. If not {@code null}, it must be a valid token. Note that <a href="http://tools.ietf.org/html/rfc6455" >RFC 6455</a> says "<i>When using the quoted-string syntax variant, the value after quoted-string...
[ "Set", "a", "value", "to", "the", "specified", "parameter", "." ]
train
https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/WebSocketExtension.java#L167-L190
jlinn/quartz-redis-jobstore
src/main/java/net/joelinn/quartz/jobstore/RedisClusterStorage.java
RedisClusterStorage.resumeTriggers
@Override public Collection<String> resumeTriggers(GroupMatcher<TriggerKey> matcher, JedisCluster jedis) throws JobPersistenceException { """ Resume (un-pause) all of the <code>{@link Trigger}s</code> in the given group. @param matcher matcher for the trigger groups to be resumed @param jedis a thread-sa...
java
@Override public Collection<String> resumeTriggers(GroupMatcher<TriggerKey> matcher, JedisCluster jedis) throws JobPersistenceException { Set<String> resumedTriggerGroups = new HashSet<>(); if (matcher.getCompareWithOperator() == StringMatcher.StringOperatorName.EQUALS) { final String tr...
[ "@", "Override", "public", "Collection", "<", "String", ">", "resumeTriggers", "(", "GroupMatcher", "<", "TriggerKey", ">", "matcher", ",", "JedisCluster", "jedis", ")", "throws", "JobPersistenceException", "{", "Set", "<", "String", ">", "resumedTriggerGroups", "...
Resume (un-pause) all of the <code>{@link Trigger}s</code> in the given group. @param matcher matcher for the trigger groups to be resumed @param jedis a thread-safe Redis connection @return the names of trigger groups which were resumed
[ "Resume", "(", "un", "-", "pause", ")", "all", "of", "the", "<code", ">", "{", "@link", "Trigger", "}", "s<", "/", "code", ">", "in", "the", "given", "group", "." ]
train
https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/RedisClusterStorage.java#L568-L588
openengsb/openengsb
components/console/src/main/java/org/openengsb/core/console/internal/util/ServicesHelper.java
ServicesHelper.deleteService
public void deleteService(String id, boolean force) { """ delete a service identified by its id, if force is true, the user does not have to confirm """ try { if (id == null || id.isEmpty()) { id = selectRunningService(); } final String idFinal = id; ...
java
public void deleteService(String id, boolean force) { try { if (id == null || id.isEmpty()) { id = selectRunningService(); } final String idFinal = id; int input = 'Y'; if (!force) { OutputStreamFormater.printValue(Strin...
[ "public", "void", "deleteService", "(", "String", "id", ",", "boolean", "force", ")", "{", "try", "{", "if", "(", "id", "==", "null", "||", "id", ".", "isEmpty", "(", ")", ")", "{", "id", "=", "selectRunningService", "(", ")", ";", "}", "final", "S...
delete a service identified by its id, if force is true, the user does not have to confirm
[ "delete", "a", "service", "identified", "by", "its", "id", "if", "force", "is", "true", "the", "user", "does", "not", "have", "to", "confirm" ]
train
https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/console/src/main/java/org/openengsb/core/console/internal/util/ServicesHelper.java#L119-L148
belaban/JGroups
src/org/jgroups/protocols/rules/SUPERVISOR.java
SUPERVISOR.installRule
public void installRule(String name, long interval, Rule rule) { """ Installs a new rule @param name The name of the rule @param interval Number of ms between executions of the rule @param rule The rule """ rule.supervisor(this).log(log).init(); Future<?> future=timer.scheduleAtFixedRate(rul...
java
public void installRule(String name, long interval, Rule rule) { rule.supervisor(this).log(log).init(); Future<?> future=timer.scheduleAtFixedRate(rule, interval, interval, TimeUnit.MILLISECONDS); Tuple<Rule,Future<?>> existing=rules.put(name != null? name : rule.name(), new Tuple<>(rule, future...
[ "public", "void", "installRule", "(", "String", "name", ",", "long", "interval", ",", "Rule", "rule", ")", "{", "rule", ".", "supervisor", "(", "this", ")", ".", "log", "(", "log", ")", ".", "init", "(", ")", ";", "Future", "<", "?", ">", "future",...
Installs a new rule @param name The name of the rule @param interval Number of ms between executions of the rule @param rule The rule
[ "Installs", "a", "new", "rule" ]
train
https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/protocols/rules/SUPERVISOR.java#L139-L145
liyiorg/weixin-popular
src/main/java/weixin/popular/support/TicketManager.java
TicketManager.destroyed
public static void destroyed(String appid,String... types) { """ 取消刷新 @param appid appid @param types ticket 类型 [jsapi,wx_card] """ for(String type : types){ String key = appid + KEY_JOIN + type; if(futureMap.containsKey(key)){ futureMap.get(key).cancel(true); logger.info("destroyed app...
java
public static void destroyed(String appid,String... types){ for(String type : types){ String key = appid + KEY_JOIN + type; if(futureMap.containsKey(key)){ futureMap.get(key).cancel(true); logger.info("destroyed appid:{} type:{}",appid,type); } } }
[ "public", "static", "void", "destroyed", "(", "String", "appid", ",", "String", "...", "types", ")", "{", "for", "(", "String", "type", ":", "types", ")", "{", "String", "key", "=", "appid", "+", "KEY_JOIN", "+", "type", ";", "if", "(", "futureMap", ...
取消刷新 @param appid appid @param types ticket 类型 [jsapi,wx_card]
[ "取消刷新" ]
train
https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/support/TicketManager.java#L173-L181
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/Drawer.java
Drawer.switchDrawerContent
public void switchDrawerContent(@NonNull OnDrawerItemClickListener onDrawerItemClickListener, OnDrawerItemLongClickListener onDrawerItemLongClickListener, @NonNull List<IDrawerItem> drawerItems, int drawerSelection) { """ method to switch the drawer content to new elements @param onDrawerItemClickListener @par...
java
public void switchDrawerContent(@NonNull OnDrawerItemClickListener onDrawerItemClickListener, OnDrawerItemLongClickListener onDrawerItemLongClickListener, @NonNull List<IDrawerItem> drawerItems, int drawerSelection) { //just allow a single switched drawer if (!switchedDrawerContent()) { //sa...
[ "public", "void", "switchDrawerContent", "(", "@", "NonNull", "OnDrawerItemClickListener", "onDrawerItemClickListener", ",", "OnDrawerItemLongClickListener", "onDrawerItemLongClickListener", ",", "@", "NonNull", "List", "<", "IDrawerItem", ">", "drawerItems", ",", "int", "d...
method to switch the drawer content to new elements @param onDrawerItemClickListener @param drawerItems @param drawerSelection
[ "method", "to", "switch", "the", "drawer", "content", "to", "new", "elements" ]
train
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java#L1003-L1029
GwtMaterialDesign/gwt-material
gwt-material/src/main/java/gwt/material/design/client/ui/MaterialLoader.java
MaterialLoader.loading
public static void loading(boolean visible, Panel container) { """ Static helper class that shows / hides a circular loader within a container """ loader.setType(LoaderType.CIRCULAR); loader.setContainer(container); if (visible) { loader.show(); } else { ...
java
public static void loading(boolean visible, Panel container) { loader.setType(LoaderType.CIRCULAR); loader.setContainer(container); if (visible) { loader.show(); } else { loader.hide(); } }
[ "public", "static", "void", "loading", "(", "boolean", "visible", ",", "Panel", "container", ")", "{", "loader", ".", "setType", "(", "LoaderType", ".", "CIRCULAR", ")", ";", "loader", ".", "setContainer", "(", "container", ")", ";", "if", "(", "visible", ...
Static helper class that shows / hides a circular loader within a container
[ "Static", "helper", "class", "that", "shows", "/", "hides", "a", "circular", "loader", "within", "a", "container" ]
train
https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialLoader.java#L146-L154
pressgang-ccms/PressGangCCMSBuilder
src/main/java/org/jboss/pressgang/ccms/contentspec/builder/DocBookBuilder.java
DocBookBuilder.buildTranslatedBook
public HashMap<String, byte[]> buildTranslatedBook(final ContentSpec contentSpec, final String requester, final DocBookBuildingOptions buildingOptions, final ZanataDetails zanataDetails) throws BuilderCreationException, BuildProcessingException { """ Builds a DocBook Formatted Book using a ...
java
public HashMap<String, byte[]> buildTranslatedBook(final ContentSpec contentSpec, final String requester, final DocBookBuildingOptions buildingOptions, final ZanataDetails zanataDetails) throws BuilderCreationException, BuildProcessingException { return buildTranslatedBook(contentSpec, r...
[ "public", "HashMap", "<", "String", ",", "byte", "[", "]", ">", "buildTranslatedBook", "(", "final", "ContentSpec", "contentSpec", ",", "final", "String", "requester", ",", "final", "DocBookBuildingOptions", "buildingOptions", ",", "final", "ZanataDetails", "zanataD...
Builds a DocBook Formatted Book using a Content Specification to define the structure and contents of the book. @param contentSpec The content specification to build from. @param requester The user who requested the build. @param buildingOptions The options to be used when building. @param zanataDetails Th...
[ "Builds", "a", "DocBook", "Formatted", "Book", "using", "a", "Content", "Specification", "to", "define", "the", "structure", "and", "contents", "of", "the", "book", "." ]
train
https://github.com/pressgang-ccms/PressGangCCMSBuilder/blob/5436d36ba1b3c5baa246b270e5fc350e6778bce8/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/DocBookBuilder.java#L404-L408
beders/Resty
src/main/java/us/monoid/json/JSONObject.java
JSONObject.optString
public String optString(Enum<?> key, String defaultValue) { """ Get an optional string associated with a key. It returns the defaultValue if there is no such key. @param key A key string. @param defaultValue The default. @return A string which is the value. """ return optString(key.name(), defaultVal...
java
public String optString(Enum<?> key, String defaultValue) { return optString(key.name(), defaultValue); }
[ "public", "String", "optString", "(", "Enum", "<", "?", ">", "key", ",", "String", "defaultValue", ")", "{", "return", "optString", "(", "key", ".", "name", "(", ")", ",", "defaultValue", ")", ";", "}" ]
Get an optional string associated with a key. It returns the defaultValue if there is no such key. @param key A key string. @param defaultValue The default. @return A string which is the value.
[ "Get", "an", "optional", "string", "associated", "with", "a", "key", ".", "It", "returns", "the", "defaultValue", "if", "there", "is", "no", "such", "key", "." ]
train
https://github.com/beders/Resty/blob/4493603e9689c942cc3e53b9c5018010e414a364/src/main/java/us/monoid/json/JSONObject.java#L1219-L1221
davidmoten/grumpy
grumpy-ogc/src/main/java/com/github/davidmoten/grumpy/wms/WmsRequest.java
WmsRequest.getBounds
private static ProjectorBounds getBounds(String crs, String s, String version) { """ Expected to be in lat long (EPSG:4326). @param s @param version @param srs @return """ if (s == null) return null; String[] items = s.split(","); double minLong; double minLat; double maxLong; doubl...
java
private static ProjectorBounds getBounds(String crs, String s, String version) { if (s == null) return null; String[] items = s.split(","); double minLong; double minLat; double maxLong; double maxLat; /** * there is some confusion about order of bbox parameters. The OpenGIS * WMS 1.3.0...
[ "private", "static", "ProjectorBounds", "getBounds", "(", "String", "crs", ",", "String", "s", ",", "String", "version", ")", "{", "if", "(", "s", "==", "null", ")", "return", "null", ";", "String", "[", "]", "items", "=", "s", ".", "split", "(", "\"...
Expected to be in lat long (EPSG:4326). @param s @param version @param srs @return
[ "Expected", "to", "be", "in", "lat", "long", "(", "EPSG", ":", "4326", ")", "." ]
train
https://github.com/davidmoten/grumpy/blob/f2d03e6b9771f15425fb3f76314837efc08c1233/grumpy-ogc/src/main/java/com/github/davidmoten/grumpy/wms/WmsRequest.java#L189-L232
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsJMSContextImpl.java
JmsJMSContextImpl.createContext
@Override public JMSContext createContext(int sessionMode) throws JMSRuntimeException { """ /* For every {@link JmsJMSContextImpl#createContext(int)} the same jmsConnection is used but a new jmsSession is created. @see javax.jms.JMSContext#createContext(int) """ if (TraceComponent.isAnyTracin...
java
@Override public JMSContext createContext(int sessionMode) throws JMSRuntimeException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "createContext", new Object[] { sessionMode }); JmsJMSContextImpl jmsContext = null; // If the context...
[ "@", "Override", "public", "JMSContext", "createContext", "(", "int", "sessionMode", ")", "throws", "JMSRuntimeException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "...
/* For every {@link JmsJMSContextImpl#createContext(int)} the same jmsConnection is used but a new jmsSession is created. @see javax.jms.JMSContext#createContext(int)
[ "/", "*", "For", "every", "{", "@link", "JmsJMSContextImpl#createContext", "(", "int", ")", "}", "the", "same", "jmsConnection", "is", "used", "but", "a", "new", "jmsSession", "is", "created", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsJMSContextImpl.java#L418-L458
primefaces-extensions/core
src/main/java/org/primefaces/extensions/component/sheet/SheetRenderer.java
SheetRenderer.encodeColHeaders
protected void encodeColHeaders(final FacesContext context, final Sheet sheet, final WidgetBuilder wb) throws IOException { """ Encode the column headers @param context @param sheet @param wb @throws IOException """ final JavascriptVarBuilder vb = new JavascriptVarBuilder(null, fa...
java
protected void encodeColHeaders(final FacesContext context, final Sheet sheet, final WidgetBuilder wb) throws IOException { final JavascriptVarBuilder vb = new JavascriptVarBuilder(null, false); for (final SheetColumn column : sheet.getColumns()) { if (!column.isRendered()) {...
[ "protected", "void", "encodeColHeaders", "(", "final", "FacesContext", "context", ",", "final", "Sheet", "sheet", ",", "final", "WidgetBuilder", "wb", ")", "throws", "IOException", "{", "final", "JavascriptVarBuilder", "vb", "=", "new", "JavascriptVarBuilder", "(", ...
Encode the column headers @param context @param sheet @param wb @throws IOException
[ "Encode", "the", "column", "headers" ]
train
https://github.com/primefaces-extensions/core/blob/afdbca591f60f47898e3517e1e939bc2f63d5355/src/main/java/org/primefaces/extensions/component/sheet/SheetRenderer.java#L261-L271
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java
TheMovieDbApi.addItemToList
public StatusCode addItemToList(String sessionId, String listId, Integer mediaId) throws MovieDbException { """ This method lets users add new items to a list that they created. A valid session id is required. @param sessionId sessionId @param listId listId @param mediaId mediaId @return true if the movie...
java
public StatusCode addItemToList(String sessionId, String listId, Integer mediaId) throws MovieDbException { return tmdbList.addItem(sessionId, listId, mediaId); }
[ "public", "StatusCode", "addItemToList", "(", "String", "sessionId", ",", "String", "listId", ",", "Integer", "mediaId", ")", "throws", "MovieDbException", "{", "return", "tmdbList", ".", "addItem", "(", "sessionId", ",", "listId", ",", "mediaId", ")", ";", "}...
This method lets users add new items to a list that they created. A valid session id is required. @param sessionId sessionId @param listId listId @param mediaId mediaId @return true if the movie is on the list @throws MovieDbException exception
[ "This", "method", "lets", "users", "add", "new", "items", "to", "a", "list", "that", "they", "created", "." ]
train
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java#L815-L817
aws/aws-sdk-java
aws-java-sdk-gamelift/src/main/java/com/amazonaws/services/gamelift/model/Player.java
Player.withLatencyInMs
public Player withLatencyInMs(java.util.Map<String, Integer> latencyInMs) { """ <p> Set of values, expressed in milliseconds, indicating the amount of latency that a player experiences when connected to AWS regions. If this property is present, FlexMatch considers placing the match only in regions for which lat...
java
public Player withLatencyInMs(java.util.Map<String, Integer> latencyInMs) { setLatencyInMs(latencyInMs); return this; }
[ "public", "Player", "withLatencyInMs", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "Integer", ">", "latencyInMs", ")", "{", "setLatencyInMs", "(", "latencyInMs", ")", ";", "return", "this", ";", "}" ]
<p> Set of values, expressed in milliseconds, indicating the amount of latency that a player experiences when connected to AWS regions. If this property is present, FlexMatch considers placing the match only in regions for which latency is reported. </p> <p> If a matchmaker has a rule that evaluates player latency, pla...
[ "<p", ">", "Set", "of", "values", "expressed", "in", "milliseconds", "indicating", "the", "amount", "of", "latency", "that", "a", "player", "experiences", "when", "connected", "to", "AWS", "regions", ".", "If", "this", "property", "is", "present", "FlexMatch",...
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-gamelift/src/main/java/com/amazonaws/services/gamelift/model/Player.java#L296-L299
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/projections/CanvasSize.java
CanvasSize.continueToMargin
public double continueToMargin(double[] origin, double[] delta) { """ Continue a line along a given direction to the margin. @param origin Origin point @param delta Direction vector @return scaling factor for delta vector """ assert (delta.length == 2 && origin.length == 2); double factor = Double...
java
public double continueToMargin(double[] origin, double[] delta) { assert (delta.length == 2 && origin.length == 2); double factor = Double.POSITIVE_INFINITY; if(delta[0] > 0) { factor = Math.min(factor, (maxx - origin[0]) / delta[0]); } else if(delta[0] < 0) { factor = Math.min(factor, (...
[ "public", "double", "continueToMargin", "(", "double", "[", "]", "origin", ",", "double", "[", "]", "delta", ")", "{", "assert", "(", "delta", ".", "length", "==", "2", "&&", "origin", ".", "length", "==", "2", ")", ";", "double", "factor", "=", "Dou...
Continue a line along a given direction to the margin. @param origin Origin point @param delta Direction vector @return scaling factor for delta vector
[ "Continue", "a", "line", "along", "a", "given", "direction", "to", "the", "margin", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/projections/CanvasSize.java#L116-L132
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/LongTermRetentionBackupsInner.java
LongTermRetentionBackupsInner.beginDeleteAsync
public Observable<Void> beginDeleteAsync(String locationName, String longTermRetentionServerName, String longTermRetentionDatabaseName, String backupName) { """ Deletes a long term retention backup. @param locationName The location of the database @param longTermRetentionServerName the String value @param lon...
java
public Observable<Void> beginDeleteAsync(String locationName, String longTermRetentionServerName, String longTermRetentionDatabaseName, String backupName) { return beginDeleteWithServiceResponseAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName).map(new Func1<ServiceRespo...
[ "public", "Observable", "<", "Void", ">", "beginDeleteAsync", "(", "String", "locationName", ",", "String", "longTermRetentionServerName", ",", "String", "longTermRetentionDatabaseName", ",", "String", "backupName", ")", "{", "return", "beginDeleteWithServiceResponseAsync",...
Deletes a long term retention backup. @param locationName The location of the database @param longTermRetentionServerName the String value @param longTermRetentionDatabaseName the String value @param backupName The backup name. @throws IllegalArgumentException thrown if parameters fail the validation @return the {@lin...
[ "Deletes", "a", "long", "term", "retention", "backup", "." ]
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/LongTermRetentionBackupsInner.java#L322-L329
owetterau/neo4j-websockets
client/src/main/java/de/oliverwetterau/neo4j/websockets/client/server/Database.java
Database.sendWriteMessage
public void sendWriteMessage(final String message, final Server server) throws ConnectionNotAvailableException { """ Sends a text message (which will probably create a write access) to the Neo4j cluster. @param message binary json message (usually json format) @param server server that shall be used to send the ...
java
public void sendWriteMessage(final String message, final Server server) throws ConnectionNotAvailableException { DataConnection connection = server.getConnection(); if (connection == null) { throw new ConnectionNotAvailableException(server); } connection.send(message); ...
[ "public", "void", "sendWriteMessage", "(", "final", "String", "message", ",", "final", "Server", "server", ")", "throws", "ConnectionNotAvailableException", "{", "DataConnection", "connection", "=", "server", ".", "getConnection", "(", ")", ";", "if", "(", "connec...
Sends a text message (which will probably create a write access) to the Neo4j cluster. @param message binary json message (usually json format) @param server server that shall be used to send the message @throws ConnectionNotAvailableException no connection to server exception
[ "Sends", "a", "text", "message", "(", "which", "will", "probably", "create", "a", "write", "access", ")", "to", "the", "Neo4j", "cluster", "." ]
train
https://github.com/owetterau/neo4j-websockets/blob/ca3481066819d01169873aeb145ab3bf5c736afe/client/src/main/java/de/oliverwetterau/neo4j/websockets/client/server/Database.java#L320-L330
italiangrid/voms-api-java
src/main/java/org/italiangrid/voms/store/impl/DefaultVOMSTrustStore.java
DefaultVOMSTrustStore.loadCertificatesFromDirectory
private void loadCertificatesFromDirectory(File directory) { """ Loads all the certificates in the local directory. Only files with the extension matching the {@link #CERTIFICATE_FILENAME_PATTERN} are considered. @param directory """ directorySanityChecks(directory); synchronized (listenerLock) ...
java
private void loadCertificatesFromDirectory(File directory) { directorySanityChecks(directory); synchronized (listenerLock) { listener.notifyCertficateLookupEvent(directory.getAbsolutePath()); } File[] certFiles = directory.listFiles(new FilenameFilter() { public boolean accept(File dir, ...
[ "private", "void", "loadCertificatesFromDirectory", "(", "File", "directory", ")", "{", "directorySanityChecks", "(", "directory", ")", ";", "synchronized", "(", "listenerLock", ")", "{", "listener", ".", "notifyCertficateLookupEvent", "(", "directory", ".", "getAbsol...
Loads all the certificates in the local directory. Only files with the extension matching the {@link #CERTIFICATE_FILENAME_PATTERN} are considered. @param directory
[ "Loads", "all", "the", "certificates", "in", "the", "local", "directory", ".", "Only", "files", "with", "the", "extension", "matching", "the", "{", "@link", "#CERTIFICATE_FILENAME_PATTERN", "}", "are", "considered", "." ]
train
https://github.com/italiangrid/voms-api-java/blob/b33d6cf98ca9449bed87b1cc307d411514589deb/src/main/java/org/italiangrid/voms/store/impl/DefaultVOMSTrustStore.java#L220-L239
zaproxy/zaproxy
src/org/parosproxy/paros/model/Session.java
Session.fillNodesInScope
private void fillNodesInScope(SiteNode rootNode, List<SiteNode> nodesList) { """ Fills a given list with nodes in scope, searching recursively. @param rootNode the root node @param nodesList the nodes list """ @SuppressWarnings("unchecked") Enumeration<TreeNode> en = rootNode.children(); while (en...
java
private void fillNodesInScope(SiteNode rootNode, List<SiteNode> nodesList) { @SuppressWarnings("unchecked") Enumeration<TreeNode> en = rootNode.children(); while (en.hasMoreElements()) { SiteNode sn = (SiteNode) en.nextElement(); if (isInScope(sn)) nodesList.add(sn); fillNodesInScope(sn, nodes...
[ "private", "void", "fillNodesInScope", "(", "SiteNode", "rootNode", ",", "List", "<", "SiteNode", ">", "nodesList", ")", "{", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "Enumeration", "<", "TreeNode", ">", "en", "=", "rootNode", ".", "children", "(", ...
Fills a given list with nodes in scope, searching recursively. @param rootNode the root node @param nodesList the nodes list
[ "Fills", "a", "given", "list", "with", "nodes", "in", "scope", "searching", "recursively", "." ]
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/model/Session.java#L900-L909
JodaOrg/joda-money
src/main/java/org/joda/money/format/MoneyFormatterBuilder.java
MoneyFormatterBuilder.appendSigned
public MoneyFormatterBuilder appendSigned( MoneyFormatter whenPositiveOrZero, MoneyFormatter whenNegative) { """ Appends the specified formatters, one used when the amount is positive, and one when the amount is negative. <p> When printing, the amount is queried and the appropriate formatter is used...
java
public MoneyFormatterBuilder appendSigned( MoneyFormatter whenPositiveOrZero, MoneyFormatter whenNegative) { return appendSigned(whenPositiveOrZero, whenPositiveOrZero, whenNegative); }
[ "public", "MoneyFormatterBuilder", "appendSigned", "(", "MoneyFormatter", "whenPositiveOrZero", ",", "MoneyFormatter", "whenNegative", ")", "{", "return", "appendSigned", "(", "whenPositiveOrZero", ",", "whenPositiveOrZero", ",", "whenNegative", ")", ";", "}" ]
Appends the specified formatters, one used when the amount is positive, and one when the amount is negative. <p> When printing, the amount is queried and the appropriate formatter is used. <p> When parsing, each formatter is tried, with the longest successful match, or the first match if multiple are successful. If the...
[ "Appends", "the", "specified", "formatters", "one", "used", "when", "the", "amount", "is", "positive", "and", "one", "when", "the", "amount", "is", "negative", ".", "<p", ">", "When", "printing", "the", "amount", "is", "queried", "and", "the", "appropriate",...
train
https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/format/MoneyFormatterBuilder.java#L216-L219
Erudika/para
para-core/src/main/java/com/erudika/para/core/User.java
User.createIdentifier
private boolean createIdentifier(String newIdent, String password) { """ Creates a new identifier object using {@link Sysprop}. Used for identifying a user when signing in. @param newIdent a new identifier @param password a password for the user (optional) @return true if successful """ if (StringUtils.i...
java
private boolean createIdentifier(String newIdent, String password) { if (StringUtils.isBlank(getId()) || StringUtils.isBlank(newIdent)) { return false; } Sysprop s = new Sysprop(); s.setId(newIdent); s.setName(Config._IDENTIFIER); s.setCreatorid(getId()); if (!StringUtils.isBlank(password)) { String...
[ "private", "boolean", "createIdentifier", "(", "String", "newIdent", ",", "String", "password", ")", "{", "if", "(", "StringUtils", ".", "isBlank", "(", "getId", "(", ")", ")", "||", "StringUtils", ".", "isBlank", "(", "newIdent", ")", ")", "{", "return", ...
Creates a new identifier object using {@link Sysprop}. Used for identifying a user when signing in. @param newIdent a new identifier @param password a password for the user (optional) @return true if successful
[ "Creates", "a", "new", "identifier", "object", "using", "{" ]
train
https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-core/src/main/java/com/erudika/para/core/User.java#L652-L666
Sciss/abc4j
abc/src/main/java/abc/ui/swing/ScoreTemplate.java
ScoreTemplate.getFieldsAtPosition
public byte[] getFieldsAtPosition(byte vert, byte horiz) { """ Returns the list of visible fields at the given position @param vert one of {@link VerticalPosition} constants @param horiz one of {@link HorizontalPosition} constants @return array of {@link ScoreElements} constants """ Position p = new ...
java
public byte[] getFieldsAtPosition(byte vert, byte horiz) { Position p = new Position(vert, horiz); if (m_fieldsPosition.get(p) != null) { Vector v = (Vector) m_fieldsPosition.get(p); Vector ret = new Vector(v.size()); for (Object aV : v) { byte field = (Byte) aV; ...
[ "public", "byte", "[", "]", "getFieldsAtPosition", "(", "byte", "vert", ",", "byte", "horiz", ")", "{", "Position", "p", "=", "new", "Position", "(", "vert", ",", "horiz", ")", ";", "if", "(", "m_fieldsPosition", ".", "get", "(", "p", ")", "!=", "nul...
Returns the list of visible fields at the given position @param vert one of {@link VerticalPosition} constants @param horiz one of {@link HorizontalPosition} constants @return array of {@link ScoreElements} constants
[ "Returns", "the", "list", "of", "visible", "fields", "at", "the", "given", "position" ]
train
https://github.com/Sciss/abc4j/blob/117b405642c84a7bfca4e3e13668838258b90ca7/abc/src/main/java/abc/ui/swing/ScoreTemplate.java#L425-L442
netscaler/sdx_nitro
src/main/java/com/citrix/sdx/nitro/resource/base/base_resource.java
base_resource.post_request
private base_resource[] post_request(nitro_service service, options option) throws Exception { """ Use this method to perform a Add operation on netscaler resource. @param service nitro_service object. @param option Options class object. @return status of the operation performed. @throws Exception if invalid ...
java
private base_resource[] post_request(nitro_service service, options option) throws Exception { return add_resource(service, option); }
[ "private", "base_resource", "[", "]", "post_request", "(", "nitro_service", "service", ",", "options", "option", ")", "throws", "Exception", "{", "return", "add_resource", "(", "service", ",", "option", ")", ";", "}" ]
Use this method to perform a Add operation on netscaler resource. @param service nitro_service object. @param option Options class object. @return status of the operation performed. @throws Exception if invalid input is given.
[ "Use", "this", "method", "to", "perform", "a", "Add", "operation", "on", "netscaler", "resource", "." ]
train
https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/base/base_resource.java#L193-L196
JadiraOrg/jadira
bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java
BasicBinder.findMarshaller
public <S, T> ToMarshaller<S, T> findMarshaller(Class<S> source, Class<T> target, Class<? extends Annotation> qualifier) { """ Resolve a Marshaller with the given source and target class. The marshaller is used as follows: Instances of the source can be marshalled into the target class. @param source The source ...
java
public <S, T> ToMarshaller<S, T> findMarshaller(Class<S> source, Class<T> target, Class<? extends Annotation> qualifier) { return findMarshaller(new ConverterKey<S,T>(source, target, qualifier == null ? DefaultBinding.class : qualifier)); }
[ "public", "<", "S", ",", "T", ">", "ToMarshaller", "<", "S", ",", "T", ">", "findMarshaller", "(", "Class", "<", "S", ">", "source", ",", "Class", "<", "T", ">", "target", ",", "Class", "<", "?", "extends", "Annotation", ">", "qualifier", ")", "{",...
Resolve a Marshaller with the given source and target class. The marshaller is used as follows: Instances of the source can be marshalled into the target class. @param source The source (input) class @param target The target (output) class @param qualifier The qualifier for which the marshaller must be registered
[ "Resolve", "a", "Marshaller", "with", "the", "given", "source", "and", "target", "class", ".", "The", "marshaller", "is", "used", "as", "follows", ":", "Instances", "of", "the", "source", "can", "be", "marshalled", "into", "the", "target", "class", "." ]
train
https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java#L953-L955
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/connector/filesystem/FileSystemConnector.java
FileSystemConnector.fileFor
protected File fileFor( String id ) { """ Utility method for obtaining the {@link File} object that corresponds to the supplied identifier. Subclasses may override this method to change the format of the identifiers, but in that case should also override the {@link #isRoot(String)}, {@link #isContentNode(String)...
java
protected File fileFor( String id ) { assert id.startsWith(DELIMITER); if (id.endsWith(DELIMITER)) { id = id.substring(0, id.length() - DELIMITER.length()); } if (isContentNode(id)) { id = id.substring(0, id.length() - JCR_CONTENT_SUFFIX_LENGTH); } ...
[ "protected", "File", "fileFor", "(", "String", "id", ")", "{", "assert", "id", ".", "startsWith", "(", "DELIMITER", ")", ";", "if", "(", "id", ".", "endsWith", "(", "DELIMITER", ")", ")", "{", "id", "=", "id", ".", "substring", "(", "0", ",", "id",...
Utility method for obtaining the {@link File} object that corresponds to the supplied identifier. Subclasses may override this method to change the format of the identifiers, but in that case should also override the {@link #isRoot(String)}, {@link #isContentNode(String)}, and {@link #idFor(File)} methods. @param id t...
[ "Utility", "method", "for", "obtaining", "the", "{", "@link", "File", "}", "object", "that", "corresponds", "to", "the", "supplied", "identifier", ".", "Subclasses", "may", "override", "this", "method", "to", "change", "the", "format", "of", "the", "identifier...
train
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/connector/filesystem/FileSystemConnector.java#L326-L335
igniterealtime/Smack
smack-core/src/main/java/org/jivesoftware/smack/provider/ProviderManager.java
ProviderManager.removeIQProvider
public static String removeIQProvider(String elementName, String namespace) { """ Removes an IQ provider with the specified element name and namespace. This method is typically called to cleanup providers that are programmatically added using the {@link #addIQProvider(String, String, Object) addIQProvider} metho...
java
public static String removeIQProvider(String elementName, String namespace) { String key = getKey(elementName, namespace); iqProviders.remove(key); return key; }
[ "public", "static", "String", "removeIQProvider", "(", "String", "elementName", ",", "String", "namespace", ")", "{", "String", "key", "=", "getKey", "(", "elementName", ",", "namespace", ")", ";", "iqProviders", ".", "remove", "(", "key", ")", ";", "return"...
Removes an IQ provider with the specified element name and namespace. This method is typically called to cleanup providers that are programmatically added using the {@link #addIQProvider(String, String, Object) addIQProvider} method. @param elementName the XML element name. @param namespace the XML namespace. @return ...
[ "Removes", "an", "IQ", "provider", "with", "the", "specified", "element", "name", "and", "namespace", ".", "This", "method", "is", "typically", "called", "to", "cleanup", "providers", "that", "are", "programmatically", "added", "using", "the", "{", "@link", "#...
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-core/src/main/java/org/jivesoftware/smack/provider/ProviderManager.java#L219-L223
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java
StatusLogger.logMessage
@Override public void logMessage(final String fqcn, final Level level, final Marker marker, final Message msg, final Throwable t) { """ Adds an event. @param marker The Marker @param fqcn The fully qualified class name of the <b>caller</b> @param level The logging level @param msg The message...
java
@Override public void logMessage(final String fqcn, final Level level, final Marker marker, final Message msg, final Throwable t) { StackTraceElement element = null; if (fqcn != null) { element = getStackTraceElement(fqcn, Thread.currentThread().getStackTrace()); } ...
[ "@", "Override", "public", "void", "logMessage", "(", "final", "String", "fqcn", ",", "final", "Level", "level", ",", "final", "Marker", "marker", ",", "final", "Message", "msg", ",", "final", "Throwable", "t", ")", "{", "StackTraceElement", "element", "=", ...
Adds an event. @param marker The Marker @param fqcn The fully qualified class name of the <b>caller</b> @param level The logging level @param msg The message associated with the event. @param t A Throwable or null.
[ "Adds", "an", "event", "." ]
train
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java#L248-L276
sjamesr/jfreesane
src/main/java/au/com/southsky/jfreesane/SaneSession.java
SaneSession.withRemoteSane
public static SaneSession withRemoteSane(InetAddress saneAddress, int port) throws IOException { """ Establishes a connection to the SANE daemon running on the given host on the given port with no connection timeout. """ return withRemoteSane(saneAddress, port, 0, TimeUnit.MILLISECONDS, 0, TimeUnit.MILLIS...
java
public static SaneSession withRemoteSane(InetAddress saneAddress, int port) throws IOException { return withRemoteSane(saneAddress, port, 0, TimeUnit.MILLISECONDS, 0, TimeUnit.MILLISECONDS); }
[ "public", "static", "SaneSession", "withRemoteSane", "(", "InetAddress", "saneAddress", ",", "int", "port", ")", "throws", "IOException", "{", "return", "withRemoteSane", "(", "saneAddress", ",", "port", ",", "0", ",", "TimeUnit", ".", "MILLISECONDS", ",", "0", ...
Establishes a connection to the SANE daemon running on the given host on the given port with no connection timeout.
[ "Establishes", "a", "connection", "to", "the", "SANE", "daemon", "running", "on", "the", "given", "host", "on", "the", "given", "port", "with", "no", "connection", "timeout", "." ]
train
https://github.com/sjamesr/jfreesane/blob/15ad0f73df0a8d0efec5167a2141cbd53afd862d/src/main/java/au/com/southsky/jfreesane/SaneSession.java#L86-L88
beangle/beangle3
ioc/spring/src/main/java/org/beangle/inject/spring/config/BeanDefinitionParser.java
BeanDefinitionParser.buildTypedStringValueForMap
protected final Object buildTypedStringValueForMap(String value, String defaultTypeName, Element entryEle) { """ Build a typed String value Object for the given raw value. @see org.springframework.beans.factory.config.TypedStringValue @param value a {@link java.lang.String} object. @param defaultTypeName a {@...
java
protected final Object buildTypedStringValueForMap(String value, String defaultTypeName, Element entryEle) { try { TypedStringValue typedValue = buildTypedStringValue(value, defaultTypeName); typedValue.setSource(extractSource(entryEle)); return typedValue; } catch (ClassNotFoundException ex) ...
[ "protected", "final", "Object", "buildTypedStringValueForMap", "(", "String", "value", ",", "String", "defaultTypeName", ",", "Element", "entryEle", ")", "{", "try", "{", "TypedStringValue", "typedValue", "=", "buildTypedStringValue", "(", "value", ",", "defaultTypeNa...
Build a typed String value Object for the given raw value. @see org.springframework.beans.factory.config.TypedStringValue @param value a {@link java.lang.String} object. @param defaultTypeName a {@link java.lang.String} object. @param entryEle a {@link org.w3c.dom.Element} object. @return a {@link java.lang.Object} ob...
[ "Build", "a", "typed", "String", "value", "Object", "for", "the", "given", "raw", "value", "." ]
train
https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/ioc/spring/src/main/java/org/beangle/inject/spring/config/BeanDefinitionParser.java#L971-L980
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/BindDataSourceSubProcessor.java
BindDataSourceSubProcessor.generateEntityName
public static String generateEntityName(SQLiteDaoDefinition dao, SQLiteEntity entity) { """ dao or entity can be null. @param dao the dao @param entity the entity @return the string """ String entityName; if (entity == null) { M2MEntity m2mEntity = M2MEntity.extractEntityManagedByDAO(dao.getEleme...
java
public static String generateEntityName(SQLiteDaoDefinition dao, SQLiteEntity entity) { String entityName; if (entity == null) { M2MEntity m2mEntity = M2MEntity.extractEntityManagedByDAO(dao.getElement()); entityName = m2mEntity.getSimpleName(); } else { entityName = entity.getSimpleName(); } return ...
[ "public", "static", "String", "generateEntityName", "(", "SQLiteDaoDefinition", "dao", ",", "SQLiteEntity", "entity", ")", "{", "String", "entityName", ";", "if", "(", "entity", "==", "null", ")", "{", "M2MEntity", "m2mEntity", "=", "M2MEntity", ".", "extractEnt...
dao or entity can be null. @param dao the dao @param entity the entity @return the string
[ "dao", "or", "entity", "can", "be", "null", "." ]
train
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/BindDataSourceSubProcessor.java#L1298-L1307
box/box-java-sdk
src/main/java/com/box/sdk/EventLog.java
EventLog.getEnterpriseEvents
public static EventLog getEnterpriseEvents(BoxAPIConnection api, String position, Date after, Date before, BoxEvent.Type... types) { """ Gets all the enterprise events that occurred within a specified date range, starting from a given position within the event stream. @par...
java
public static EventLog getEnterpriseEvents(BoxAPIConnection api, String position, Date after, Date before, BoxEvent.Type... types) { return getEnterpriseEvents(api, position, after, before, ENTERPRISE_LIMIT, types); }
[ "public", "static", "EventLog", "getEnterpriseEvents", "(", "BoxAPIConnection", "api", ",", "String", "position", ",", "Date", "after", ",", "Date", "before", ",", "BoxEvent", ".", "Type", "...", "types", ")", "{", "return", "getEnterpriseEvents", "(", "api", ...
Gets all the enterprise events that occurred within a specified date range, starting from a given position within the event stream. @param api the API connection to use. @param position the starting position of the event stream. @param after the lower bound on the timestamp of the events returned. @param bef...
[ "Gets", "all", "the", "enterprise", "events", "that", "occurred", "within", "a", "specified", "date", "range", "starting", "from", "a", "given", "position", "within", "the", "event", "stream", "." ]
train
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/EventLog.java#L61-L64
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.getStructuralProperty
public static StructuralProperty getStructuralProperty(EntityDataModel entityDataModel, StructuredType structuredType, String propertyName) { """ Get the 'Structural Property' from the given 'Entity Data Model' and 'Structured Type' looking up all the base...
java
public static StructuralProperty getStructuralProperty(EntityDataModel entityDataModel, StructuredType structuredType, String propertyName) { StructuralProperty structuralProperty = structuredType.getStructuralProperty(propertyName); if (struct...
[ "public", "static", "StructuralProperty", "getStructuralProperty", "(", "EntityDataModel", "entityDataModel", ",", "StructuredType", "structuredType", ",", "String", "propertyName", ")", "{", "StructuralProperty", "structuralProperty", "=", "structuredType", ".", "getStructur...
Get the 'Structural Property' from the given 'Entity Data Model' and 'Structured Type' looking up all the base types recursively. @param entityDataModel The given 'Entity Data Model'. @param structuredType The given 'Structured Type'. @param propertyName The name of the property to look up. @return The 'Structural...
[ "Get", "the", "Structural", "Property", "from", "the", "given", "Entity", "Data", "Model", "and", "Structured", "Type", "looking", "up", "all", "the", "base", "types", "recursively", "." ]
train
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L391-L408
BioPAX/Paxtools
json-converter/src/main/java/org/biopax/paxtools/io/jsonld/JsonldBiopaxConverter.java
JsonldBiopaxConverter.convertFromJsonld
public void convertFromJsonld(InputStream in, OutputStream out) { """ /* Convert inputstream in jsonld format to outputsream if owl/rdf format """ Model modelJena = ModelFactory.createDefaultModel(); if (in == null) { throw new IllegalArgumentException("Input File: " + " not found"); } if (out ==...
java
public void convertFromJsonld(InputStream in, OutputStream out) { Model modelJena = ModelFactory.createDefaultModel(); if (in == null) { throw new IllegalArgumentException("Input File: " + " not found"); } if (out == null) { throw new IllegalArgumentException("Output File: " + " not found"); } // r...
[ "public", "void", "convertFromJsonld", "(", "InputStream", "in", ",", "OutputStream", "out", ")", "{", "Model", "modelJena", "=", "ModelFactory", ".", "createDefaultModel", "(", ")", ";", "if", "(", "in", "==", "null", ")", "{", "throw", "new", "IllegalArgum...
/* Convert inputstream in jsonld format to outputsream if owl/rdf format
[ "/", "*", "Convert", "inputstream", "in", "jsonld", "format", "to", "outputsream", "if", "owl", "/", "rdf", "format" ]
train
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/json-converter/src/main/java/org/biopax/paxtools/io/jsonld/JsonldBiopaxConverter.java#L65-L82
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java
AssertKripton.assertTrueOfInvalidDefinition
public static void assertTrueOfInvalidDefinition(boolean expression, ModelProperty property, String message) { """ Assert true of invalid definition. @param expression the expression @param property the property @param message the message """ if (!expression) { String msg = String.format("In class...
java
public static void assertTrueOfInvalidDefinition(boolean expression, ModelProperty property, String message) { if (!expression) { String msg = String.format("In class '%s', property '%s' has invalid definition: %s", property.getParent().getElement().asType().toString(), property.getName(), message); throw ...
[ "public", "static", "void", "assertTrueOfInvalidDefinition", "(", "boolean", "expression", ",", "ModelProperty", "property", ",", "String", "message", ")", "{", "if", "(", "!", "expression", ")", "{", "String", "msg", "=", "String", ".", "format", "(", "\"In c...
Assert true of invalid definition. @param expression the expression @param property the property @param message the message
[ "Assert", "true", "of", "invalid", "definition", "." ]
train
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java#L410-L416
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/ajp/AJP13Listener.java
AJP13Listener.createConnection
protected AJP13Connection createConnection(Socket socket) throws IOException { """ Create an AJP13Connection instance. This method can be used to override the connection instance. @param socket The underlying socket. """ return new AJP13Connection(this,socket.getInputStream(),socket.getOutputStrea...
java
protected AJP13Connection createConnection(Socket socket) throws IOException { return new AJP13Connection(this,socket.getInputStream(),socket.getOutputStream(),socket,getBufferSize()); }
[ "protected", "AJP13Connection", "createConnection", "(", "Socket", "socket", ")", "throws", "IOException", "{", "return", "new", "AJP13Connection", "(", "this", ",", "socket", ".", "getInputStream", "(", ")", ",", "socket", ".", "getOutputStream", "(", ")", ",",...
Create an AJP13Connection instance. This method can be used to override the connection instance. @param socket The underlying socket.
[ "Create", "an", "AJP13Connection", "instance", ".", "This", "method", "can", "be", "used", "to", "override", "the", "connection", "instance", "." ]
train
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/ajp/AJP13Listener.java#L223-L226
lambdazen/bitsy
src/main/java/com/lambdazen/bitsy/index/BitsyIndexMap.java
BitsyIndexMap.get
public Collection<BeanType> get(String key, Object value) { """ This method returns a copy of the edges/vertices held for the given key and value """ IndexType index = indexMap.get(key); if (index == null) { throw new BitsyException(BitsyErrorCodes.MISSING_INDEX, "An index ...
java
public Collection<BeanType> get(String key, Object value) { IndexType index = indexMap.get(key); if (index == null) { throw new BitsyException(BitsyErrorCodes.MISSING_INDEX, "An index on " + key + " must be created before querying vertices/edges by that key. Defined indexes: " + ind...
[ "public", "Collection", "<", "BeanType", ">", "get", "(", "String", "key", ",", "Object", "value", ")", "{", "IndexType", "index", "=", "indexMap", ".", "get", "(", "key", ")", ";", "if", "(", "index", "==", "null", ")", "{", "throw", "new", "BitsyEx...
This method returns a copy of the edges/vertices held for the given key and value
[ "This", "method", "returns", "a", "copy", "of", "the", "edges", "/", "vertices", "held", "for", "the", "given", "key", "and", "value" ]
train
https://github.com/lambdazen/bitsy/blob/c0dd4b6c9d6dc9987d0168c91417eb04d80bf712/src/main/java/com/lambdazen/bitsy/index/BitsyIndexMap.java#L23-L31
elki-project/elki
elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/APRIORI.java
APRIORI.debugDumpCandidates
private StringBuilder debugDumpCandidates(StringBuilder msg, List<? extends Itemset> candidates, VectorFieldTypeInformation<BitVector> meta) { """ Debug method: output all itemsets. @param msg Output buffer @param candidates Itemsets to dump @param meta Metadata for item labels @return Output buffer """ ...
java
private StringBuilder debugDumpCandidates(StringBuilder msg, List<? extends Itemset> candidates, VectorFieldTypeInformation<BitVector> meta) { msg.append(':'); for(Itemset itemset : candidates) { msg.append(" ["); itemset.appendTo(msg, meta); msg.append(']'); } return msg; }
[ "private", "StringBuilder", "debugDumpCandidates", "(", "StringBuilder", "msg", ",", "List", "<", "?", "extends", "Itemset", ">", "candidates", ",", "VectorFieldTypeInformation", "<", "BitVector", ">", "meta", ")", "{", "msg", ".", "append", "(", "'", "'", ")"...
Debug method: output all itemsets. @param msg Output buffer @param candidates Itemsets to dump @param meta Metadata for item labels @return Output buffer
[ "Debug", "method", ":", "output", "all", "itemsets", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/APRIORI.java#L569-L577
Ordinastie/MalisisCore
src/main/java/net/malisis/core/util/blockdata/BlockDataHandler.java
BlockDataHandler.setData
public static <T> void setData(String identifier, IBlockAccess world, BlockPos pos, T data) { """ Sets the custom data to be stored at the {@link BlockPos} for the specified identifier. @param <T> the generic type @param identifier the identifier @param world the world @param pos the pos @param data the dat...
java
public static <T> void setData(String identifier, IBlockAccess world, BlockPos pos, T data) { setData(identifier, world, pos, data, false); }
[ "public", "static", "<", "T", ">", "void", "setData", "(", "String", "identifier", ",", "IBlockAccess", "world", ",", "BlockPos", "pos", ",", "T", "data", ")", "{", "setData", "(", "identifier", ",", "world", ",", "pos", ",", "data", ",", "false", ")",...
Sets the custom data to be stored at the {@link BlockPos} for the specified identifier. @param <T> the generic type @param identifier the identifier @param world the world @param pos the pos @param data the data
[ "Sets", "the", "custom", "data", "to", "be", "stored", "at", "the", "{", "@link", "BlockPos", "}", "for", "the", "specified", "identifier", "." ]
train
https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/blockdata/BlockDataHandler.java#L305-L308
jMotif/SAX
src/main/java/net/seninp/jmotif/distance/EuclideanDistance.java
EuclideanDistance.earlyAbandonedDistance
public Double earlyAbandonedDistance(double[] series1, double[] series2, double cutoff) throws Exception { """ Implements Euclidean distance with early abandoning. @param series1 the first series. @param series2 the second series. @param cutoff the cut-off threshold @return the distance if it is less ...
java
public Double earlyAbandonedDistance(double[] series1, double[] series2, double cutoff) throws Exception { if (series1.length == series2.length) { double cutOff2 = cutoff; if (Double.MAX_VALUE != cutoff) { cutOff2 = cutoff * cutoff; } Double res = 0D; for (int i =...
[ "public", "Double", "earlyAbandonedDistance", "(", "double", "[", "]", "series1", ",", "double", "[", "]", "series2", ",", "double", "cutoff", ")", "throws", "Exception", "{", "if", "(", "series1", ".", "length", "==", "series2", ".", "length", ")", "{", ...
Implements Euclidean distance with early abandoning. @param series1 the first series. @param series2 the second series. @param cutoff the cut-off threshold @return the distance if it is less than cutoff or Double.NAN if it is above. @throws Exception if error occurs.
[ "Implements", "Euclidean", "distance", "with", "early", "abandoning", "." ]
train
https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/distance/EuclideanDistance.java#L154-L173
alkacon/opencms-core
src/org/opencms/file/CmsObject.java
CmsObject.deleteRelationsFromResource
public void deleteRelationsFromResource(CmsResource resource, CmsRelationFilter filter) throws CmsException { """ Deletes the relations to a given resource.<p> @param resource the resource to delete the relations from @param filter the filter to use for deleting the relations @throws CmsException if somethi...
java
public void deleteRelationsFromResource(CmsResource resource, CmsRelationFilter filter) throws CmsException { m_securityManager.deleteRelationsForResource(m_context, resource, filter); }
[ "public", "void", "deleteRelationsFromResource", "(", "CmsResource", "resource", ",", "CmsRelationFilter", "filter", ")", "throws", "CmsException", "{", "m_securityManager", ".", "deleteRelationsForResource", "(", "m_context", ",", "resource", ",", "filter", ")", ";", ...
Deletes the relations to a given resource.<p> @param resource the resource to delete the relations from @param filter the filter to use for deleting the relations @throws CmsException if something goes wrong
[ "Deletes", "the", "relations", "to", "a", "given", "resource", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L1007-L1010
jbundle/jbundle
base/remote/src/main/java/org/jbundle/base/remote/db/DatabaseSession.java
DatabaseSession.setDBProperties
synchronized public void setDBProperties(Map<String, Object> properties) throws DBException, RemoteException { """ Get the database properties. @return The database properties object (Always non-null). """ m_database.setProperties(properties); }
java
synchronized public void setDBProperties(Map<String, Object> properties) throws DBException, RemoteException { m_database.setProperties(properties); }
[ "synchronized", "public", "void", "setDBProperties", "(", "Map", "<", "String", ",", "Object", ">", "properties", ")", "throws", "DBException", ",", "RemoteException", "{", "m_database", ".", "setProperties", "(", "properties", ")", ";", "}" ]
Get the database properties. @return The database properties object (Always non-null).
[ "Get", "the", "database", "properties", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/db/DatabaseSession.java#L148-L151
jayantk/jklol
src/com/jayantkrish/jklol/tensor/DenseTensor.java
DenseTensor.fastInnerProductRightAligned
private DenseTensor fastInnerProductRightAligned(Tensor other, long maxKeyNum, long keyNumIncrement, int[] newDims, int[] newSizes) { """ Fast implementation of inner product that takes advantage of potential sparsity in {@code other}. Requires alignment between the dimensions of {@code this} and {@code o...
java
private DenseTensor fastInnerProductRightAligned(Tensor other, long maxKeyNum, long keyNumIncrement, int[] newDims, int[] newSizes) { DenseTensorBuilder resultBuilder = new DenseTensorBuilder(newDims, newSizes); int otherSize = other.size(); double[] otherValues = other.getValues(); // It...
[ "private", "DenseTensor", "fastInnerProductRightAligned", "(", "Tensor", "other", ",", "long", "maxKeyNum", ",", "long", "keyNumIncrement", ",", "int", "[", "]", "newDims", ",", "int", "[", "]", "newSizes", ")", "{", "DenseTensorBuilder", "resultBuilder", "=", "...
Fast implementation of inner product that takes advantage of potential sparsity in {@code other}. Requires alignment between the dimensions of {@code this} and {@code other}. @param other @return
[ "Fast", "implementation", "of", "inner", "product", "that", "takes", "advantage", "of", "potential", "sparsity", "in", "{", "@code", "other", "}", ".", "Requires", "alignment", "between", "the", "dimensions", "of", "{", "@code", "this", "}", "and", "{", "@co...
train
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/tensor/DenseTensor.java#L267-L289
VoltDB/voltdb
src/frontend/org/voltdb/exportclient/ExportRow.java
ExportRow.decodeNextColumn
private static Object decodeNextColumn(ByteBuffer bb, VoltType columnType) throws IOException { """ Rather, it decodes the next non-null column in the FastDeserializer """ Object retval = null; switch (columnType) { case TINYINT: retval = decodeTinyInt(bb); ...
java
private static Object decodeNextColumn(ByteBuffer bb, VoltType columnType) throws IOException { Object retval = null; switch (columnType) { case TINYINT: retval = decodeTinyInt(bb); break; case SMALLINT: retval = decodeSmallInt(bb); ...
[ "private", "static", "Object", "decodeNextColumn", "(", "ByteBuffer", "bb", ",", "VoltType", "columnType", ")", "throws", "IOException", "{", "Object", "retval", "=", "null", ";", "switch", "(", "columnType", ")", "{", "case", "TINYINT", ":", "retval", "=", ...
Rather, it decodes the next non-null column in the FastDeserializer
[ "Rather", "it", "decodes", "the", "next", "non", "-", "null", "column", "in", "the", "FastDeserializer" ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/exportclient/ExportRow.java#L224-L266
mgormley/pacaya
src/main/java/edu/jhu/pacaya/gm/model/IndexForVc.java
IndexForVc.getConfigIndex
public static int getConfigIndex(VarSet vars, VarConfig config) { """ Gets the index of the configuration of the variables where all those in config have the specified value, and all other variables in vars have the zero state. @param vars The variable set over which to iterate. @param config An assignment to...
java
public static int getConfigIndex(VarSet vars, VarConfig config) { int configIndex = 0; int numStatesProd = 1; for (int v=vars.size()-1; v >= 0; v--) { Var var = vars.get(v); int state = config.getState(var, 0); configIndex += state * numStatesProd; ...
[ "public", "static", "int", "getConfigIndex", "(", "VarSet", "vars", ",", "VarConfig", "config", ")", "{", "int", "configIndex", "=", "0", ";", "int", "numStatesProd", "=", "1", ";", "for", "(", "int", "v", "=", "vars", ".", "size", "(", ")", "-", "1"...
Gets the index of the configuration of the variables where all those in config have the specified value, and all other variables in vars have the zero state. @param vars The variable set over which to iterate. @param config An assignment to a subset of vars. @return The configuration index.
[ "Gets", "the", "index", "of", "the", "configuration", "of", "the", "variables", "where", "all", "those", "in", "config", "have", "the", "specified", "value", "and", "all", "other", "variables", "in", "vars", "have", "the", "zero", "state", "." ]
train
https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/model/IndexForVc.java#L74-L84
cryptomator/cryptofs
src/main/java/org/cryptomator/cryptofs/migration/Migrators.java
Migrators.needsMigration
public boolean needsMigration(Path pathToVault, String masterkeyFilename) throws IOException { """ Inspects the vault and checks if it is supported by this library. @param pathToVault Path to the vault's root @param masterkeyFilename Name of the masterkey file located in the vault @return <code>true</code> if...
java
public boolean needsMigration(Path pathToVault, String masterkeyFilename) throws IOException { Path masterKeyPath = pathToVault.resolve(masterkeyFilename); byte[] keyFileContents = Files.readAllBytes(masterKeyPath); KeyFile keyFile = KeyFile.parse(keyFileContents); return keyFile.getVersion() < Constants.VAULT_...
[ "public", "boolean", "needsMigration", "(", "Path", "pathToVault", ",", "String", "masterkeyFilename", ")", "throws", "IOException", "{", "Path", "masterKeyPath", "=", "pathToVault", ".", "resolve", "(", "masterkeyFilename", ")", ";", "byte", "[", "]", "keyFileCon...
Inspects the vault and checks if it is supported by this library. @param pathToVault Path to the vault's root @param masterkeyFilename Name of the masterkey file located in the vault @return <code>true</code> if the vault at the given path is of an older format than supported by this library @throws IOException if an ...
[ "Inspects", "the", "vault", "and", "checks", "if", "it", "is", "supported", "by", "this", "library", "." ]
train
https://github.com/cryptomator/cryptofs/blob/67fc1a4950dd1c150cd2e2c75bcabbeb7c9ac82e/src/main/java/org/cryptomator/cryptofs/migration/Migrators.java#L74-L79
GoogleCloudPlatform/appengine-pipelines
java/src/main/java/com/google/appengine/tools/pipeline/Job.java
Job.futureCall
public <T, T1, T2, T3, T4> FutureValue<T> futureCall(Job4<T, T1, T2, T3, T4> jobInstance, Value<? extends T1> v1, Value<? extends T2> v2, Value<? extends T3> v3, Value<? extends T4> v4, JobSetting... settings) { """ Invoke this method from within the {@code run} method of a <b>generator job</b> in ord...
java
public <T, T1, T2, T3, T4> FutureValue<T> futureCall(Job4<T, T1, T2, T3, T4> jobInstance, Value<? extends T1> v1, Value<? extends T2> v2, Value<? extends T3> v3, Value<? extends T4> v4, JobSetting... settings) { return futureCallUnchecked(settings, jobInstance, v1, v2, v3, v4); }
[ "public", "<", "T", ",", "T1", ",", "T2", ",", "T3", ",", "T4", ">", "FutureValue", "<", "T", ">", "futureCall", "(", "Job4", "<", "T", ",", "T1", ",", "T2", ",", "T3", ",", "T4", ">", "jobInstance", ",", "Value", "<", "?", "extends", "T1", "...
Invoke this method from within the {@code run} method of a <b>generator job</b> in order to specify a job node in the generated child job graph. This version of the method is for child jobs that take four arguments. @param <T> The return type of the child job being specified @param <T1> The type of the first input to ...
[ "Invoke", "this", "method", "from", "within", "the", "{", "@code", "run", "}", "method", "of", "a", "<b", ">", "generator", "job<", "/", "b", ">", "in", "order", "to", "specify", "a", "job", "node", "in", "the", "generated", "child", "job", "graph", ...
train
https://github.com/GoogleCloudPlatform/appengine-pipelines/blob/277394648dac3e8214677af898935d07399ac8e1/java/src/main/java/com/google/appengine/tools/pipeline/Job.java#L291-L295
uber/NullAway
nullaway/src/main/java/com/uber/nullaway/NullAway.java
NullAway.updateEnvironmentMapping
private void updateEnvironmentMapping(Tree tree, VisitorState state) { """ Updates the {@link EnclosingEnvironmentNullness} with an entry for lambda or anonymous class, capturing nullability info for locals just before the declaration of the entity @param tree either a lambda or a local / anonymous class @par...
java
private void updateEnvironmentMapping(Tree tree, VisitorState state) { AccessPathNullnessAnalysis analysis = getNullnessAnalysis(state); // two notes: // 1. we are free to take local variable information from the program point before // the lambda / class declaration as only effectively final variables ...
[ "private", "void", "updateEnvironmentMapping", "(", "Tree", "tree", ",", "VisitorState", "state", ")", "{", "AccessPathNullnessAnalysis", "analysis", "=", "getNullnessAnalysis", "(", "state", ")", ";", "// two notes:", "// 1. we are free to take local variable information fro...
Updates the {@link EnclosingEnvironmentNullness} with an entry for lambda or anonymous class, capturing nullability info for locals just before the declaration of the entity @param tree either a lambda or a local / anonymous class @param state visitor state
[ "Updates", "the", "{", "@link", "EnclosingEnvironmentNullness", "}", "with", "an", "entry", "for", "lambda", "or", "anonymous", "class", "capturing", "nullability", "info", "for", "locals", "just", "before", "the", "declaration", "of", "the", "entity" ]
train
https://github.com/uber/NullAway/blob/c3979b4241f80411dbba6aac3ff653acbb88d00b/nullaway/src/main/java/com/uber/nullaway/NullAway.java#L363-L373
JOML-CI/JOML
src/org/joml/Matrix4x3f.java
Matrix4x3f.rotateLocal
public Matrix4x3f rotateLocal(float ang, float x, float y, float z) { """ Pre-multiply a rotation to this matrix by rotating the given amount of radians about the specified <code>(x, y, z)</code> axis. <p> The axis described by the three components needs to be a unit vector. <p> When used with a right-handed ...
java
public Matrix4x3f rotateLocal(float ang, float x, float y, float z) { return rotateLocal(ang, x, y, z, this); }
[ "public", "Matrix4x3f", "rotateLocal", "(", "float", "ang", ",", "float", "x", ",", "float", "y", ",", "float", "z", ")", "{", "return", "rotateLocal", "(", "ang", ",", "x", ",", "y", ",", "z", ",", "this", ")", ";", "}" ]
Pre-multiply a rotation to this matrix by rotating the given amount of radians about the specified <code>(x, y, z)</code> axis. <p> The axis described by the three components needs to be a unit vector. <p> When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise arou...
[ "Pre", "-", "multiply", "a", "rotation", "to", "this", "matrix", "by", "rotating", "the", "given", "amount", "of", "radians", "about", "the", "specified", "<code", ">", "(", "x", "y", "z", ")", "<", "/", "code", ">", "axis", ".", "<p", ">", "The", ...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3f.java#L4214-L4216
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/util/AlbumUtils.java
AlbumUtils.getUri
@NonNull public static Uri getUri(@NonNull Context context, @NonNull File outPath) { """ Generates an externally accessed URI based on path. @param context context. @param outPath file path. @return the uri address of the file. """ Uri uri; if (Build.VERSION.SDK_INT < Build.VERSION_COD...
java
@NonNull public static Uri getUri(@NonNull Context context, @NonNull File outPath) { Uri uri; if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { uri = Uri.fromFile(outPath); } else { uri = CameraFileProvider.getUriForFile(context, CameraFileProvider.getProviderName(...
[ "@", "NonNull", "public", "static", "Uri", "getUri", "(", "@", "NonNull", "Context", "context", ",", "@", "NonNull", "File", "outPath", ")", "{", "Uri", "uri", ";", "if", "(", "Build", ".", "VERSION", ".", "SDK_INT", "<", "Build", ".", "VERSION_CODES", ...
Generates an externally accessed URI based on path. @param context context. @param outPath file path. @return the uri address of the file.
[ "Generates", "an", "externally", "accessed", "URI", "based", "on", "path", "." ]
train
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/util/AlbumUtils.java#L155-L164
google/j2objc
translator/src/main/java/com/google/devtools/j2objc/util/NameTable.java
NameTable.getFunctionName
public String getFunctionName(ExecutableElement method) { """ Returns an appropriate name to use for this method as a function. This name is guaranteed to be unique within the declaring class, if no methods in the class have a renaming. The returned name should be given an appropriate prefix to avoid collisions...
java
public String getFunctionName(ExecutableElement method) { String name = ElementUtil.getSelector(method); if (name == null) { name = getRenamedMethodName(method); } if (name != null) { return name.replaceAll(":", "_"); } else { return addParamNames(method, getMethodName(method), '_'...
[ "public", "String", "getFunctionName", "(", "ExecutableElement", "method", ")", "{", "String", "name", "=", "ElementUtil", ".", "getSelector", "(", "method", ")", ";", "if", "(", "name", "==", "null", ")", "{", "name", "=", "getRenamedMethodName", "(", "meth...
Returns an appropriate name to use for this method as a function. This name is guaranteed to be unique within the declaring class, if no methods in the class have a renaming. The returned name should be given an appropriate prefix to avoid collisions with methods from other classes.
[ "Returns", "an", "appropriate", "name", "to", "use", "for", "this", "method", "as", "a", "function", ".", "This", "name", "is", "guaranteed", "to", "be", "unique", "within", "the", "declaring", "class", "if", "no", "methods", "in", "the", "class", "have", ...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/translator/src/main/java/com/google/devtools/j2objc/util/NameTable.java#L439-L449
khuxtable/seaglass
src/main/java/com/seaglasslookandfeel/SeaGlassSynthPainterImpl.java
SeaGlassSynthPainterImpl.paintBorder
private void paintBorder(SynthContext ctx, Graphics g, int x, int y, int w, int h, AffineTransform transform) { """ Paint the object's border. @param ctx the SynthContext. @param g the Graphics context. @param x the x location corresponding to the upper-left coordinate to paint. @param...
java
private void paintBorder(SynthContext ctx, Graphics g, int x, int y, int w, int h, AffineTransform transform) { SeaGlassPainter borderPainter = style.getBorderPainter(ctx); if (borderPainter != null) { paint(borderPainter, ctx, g, x, y, w, h, transform); } }
[ "private", "void", "paintBorder", "(", "SynthContext", "ctx", ",", "Graphics", "g", ",", "int", "x", ",", "int", "y", ",", "int", "w", ",", "int", "h", ",", "AffineTransform", "transform", ")", "{", "SeaGlassPainter", "borderPainter", "=", "style", ".", ...
Paint the object's border. @param ctx the SynthContext. @param g the Graphics context. @param x the x location corresponding to the upper-left coordinate to paint. @param y the y location corresponding to the upper left coordinate to paint. @param w the width to paint. @param h ...
[ "Paint", "the", "object", "s", "border", "." ]
train
https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/SeaGlassSynthPainterImpl.java#L186-L192
google/error-prone-javac
src/jdk.jshell/share/classes/jdk/jshell/MemoryFileManager.java
MemoryFileManager.isSameFile
@Override public boolean isSameFile(FileObject a, FileObject b) { """ Compares two file objects and return true if they represent the same underlying object. @param a a file object @param b a file object @return true if the given file objects represent the same underlying object @throws IllegalArgume...
java
@Override public boolean isSameFile(FileObject a, FileObject b) { return stdFileManager.isSameFile(b, b); }
[ "@", "Override", "public", "boolean", "isSameFile", "(", "FileObject", "a", ",", "FileObject", "b", ")", "{", "return", "stdFileManager", ".", "isSameFile", "(", "b", ",", "b", ")", ";", "}" ]
Compares two file objects and return true if they represent the same underlying object. @param a a file object @param b a file object @return true if the given file objects represent the same underlying object @throws IllegalArgumentException if either of the arguments were created with another file manager and this ...
[ "Compares", "two", "file", "objects", "and", "return", "true", "if", "they", "represent", "the", "same", "underlying", "object", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jshell/share/classes/jdk/jshell/MemoryFileManager.java#L306-L309
finmath/finmath-lib
src/main/java/net/finmath/marketdata2/products/SwapAnnuity.java
SwapAnnuity.getSwapAnnuity
public static RandomVariable getSwapAnnuity(Schedule schedule, DiscountCurveInterface discountCurve) { """ Function to calculate an (idealized) swap annuity for a given schedule and discount curve. Note: This method will consider evaluationTime being 0, see {@link net.finmath.marketdata2.products.SwapAnnuity#ge...
java
public static RandomVariable getSwapAnnuity(Schedule schedule, DiscountCurveInterface discountCurve) { double evaluationTime = 0.0; // Consider only payment time > 0 return getSwapAnnuity(evaluationTime, schedule, discountCurve, null); }
[ "public", "static", "RandomVariable", "getSwapAnnuity", "(", "Schedule", "schedule", ",", "DiscountCurveInterface", "discountCurve", ")", "{", "double", "evaluationTime", "=", "0.0", ";", "// Consider only payment time > 0", "return", "getSwapAnnuity", "(", "evaluationTime"...
Function to calculate an (idealized) swap annuity for a given schedule and discount curve. Note: This method will consider evaluationTime being 0, see {@link net.finmath.marketdata2.products.SwapAnnuity#getSwapAnnuity(double, Schedule, DiscountCurveInterface, AnalyticModel)}. @param schedule The schedule discretizati...
[ "Function", "to", "calculate", "an", "(", "idealized", ")", "swap", "annuity", "for", "a", "given", "schedule", "and", "discount", "curve", "." ]
train
https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/marketdata2/products/SwapAnnuity.java#L85-L88
VoltDB/voltdb
src/frontend/org/voltdb/jdbc/JDBC4PreparedStatement.java
JDBC4PreparedStatement.setDate
@Override public void setDate(int parameterIndex, Date x) throws SQLException { """ Sets the designated parameter to the given java.sql.Date value using the default time zone of the virtual machine that is running the application. """ checkParameterBounds(parameterIndex); throw SQLError.noS...
java
@Override public void setDate(int parameterIndex, Date x) throws SQLException { checkParameterBounds(parameterIndex); throw SQLError.noSupport(); }
[ "@", "Override", "public", "void", "setDate", "(", "int", "parameterIndex", ",", "Date", "x", ")", "throws", "SQLException", "{", "checkParameterBounds", "(", "parameterIndex", ")", ";", "throw", "SQLError", ".", "noSupport", "(", ")", ";", "}" ]
Sets the designated parameter to the given java.sql.Date value using the default time zone of the virtual machine that is running the application.
[ "Sets", "the", "designated", "parameter", "to", "the", "given", "java", ".", "sql", ".", "Date", "value", "using", "the", "default", "time", "zone", "of", "the", "virtual", "machine", "that", "is", "running", "the", "application", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4PreparedStatement.java#L318-L323
casmi/casmi
src/main/java/casmi/graphics/color/CMYKColor.java
CMYKColor.lerpColor
public static Color lerpColor(ColorSet colorSet1, ColorSet colorSet2, double amt) { """ Calculates a color or colors between two color at a specific increment. @param colorSet1 interpolate from this color @param colorSet2 interpolate to this color @param amt between 0.0 and 1.0 @return The calculated c...
java
public static Color lerpColor(ColorSet colorSet1, ColorSet colorSet2, double amt) { return lerpColor((CMYKColor)CMYKColor.color(colorSet1), (CMYKColor)CMYKColor.color(colorSet2), amt); }
[ "public", "static", "Color", "lerpColor", "(", "ColorSet", "colorSet1", ",", "ColorSet", "colorSet2", ",", "double", "amt", ")", "{", "return", "lerpColor", "(", "(", "CMYKColor", ")", "CMYKColor", ".", "color", "(", "colorSet1", ")", ",", "(", "CMYKColor", ...
Calculates a color or colors between two color at a specific increment. @param colorSet1 interpolate from this color @param colorSet2 interpolate to this color @param amt between 0.0 and 1.0 @return The calculated color values.
[ "Calculates", "a", "color", "or", "colors", "between", "two", "color", "at", "a", "specific", "increment", "." ]
train
https://github.com/casmi/casmi/blob/90f6514a9cbce0685186e7a92beb69e22a3b11c4/src/main/java/casmi/graphics/color/CMYKColor.java#L164-L166
sd4324530/fastweixin
src/main/java/com/github/sd4324530/fastweixin/util/BeanUtil.java
BeanUtil.requireNonNull
public static Object requireNonNull(Object object, String errorMessage) { """ 判断对象是否为空,如果为空,直接抛出异常 @param object 需要检查的对象 @param errorMessage 异常信息 @return 非空的对象 """ if (null == object) { throw new NullPointerException(errorMessage); } return object; }
java
public static Object requireNonNull(Object object, String errorMessage) { if (null == object) { throw new NullPointerException(errorMessage); } return object; }
[ "public", "static", "Object", "requireNonNull", "(", "Object", "object", ",", "String", "errorMessage", ")", "{", "if", "(", "null", "==", "object", ")", "{", "throw", "new", "NullPointerException", "(", "errorMessage", ")", ";", "}", "return", "object", ";"...
判断对象是否为空,如果为空,直接抛出异常 @param object 需要检查的对象 @param errorMessage 异常信息 @return 非空的对象
[ "判断对象是否为空,如果为空,直接抛出异常" ]
train
https://github.com/sd4324530/fastweixin/blob/6bc0a7abfa23aad0dbad4c3123a47a7fb53f3447/src/main/java/com/github/sd4324530/fastweixin/util/BeanUtil.java#L43-L48
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/core/Parser.java
Parser.parseMoveKeyword
public static boolean parseMoveKeyword(final char[] query, int offset) { """ Parse string to check presence of MOVE keyword regardless of case. @param query char[] of the query statement @param offset position of query to start checking @return boolean indicates presence of word """ if (query.length <...
java
public static boolean parseMoveKeyword(final char[] query, int offset) { if (query.length < (offset + 4)) { return false; } return (query[offset] | 32) == 'm' && (query[offset + 1] | 32) == 'o' && (query[offset + 2] | 32) == 'v' && (query[offset + 3] | 32) == 'e'; }
[ "public", "static", "boolean", "parseMoveKeyword", "(", "final", "char", "[", "]", "query", ",", "int", "offset", ")", "{", "if", "(", "query", ".", "length", "<", "(", "offset", "+", "4", ")", ")", "{", "return", "false", ";", "}", "return", "(", ...
Parse string to check presence of MOVE keyword regardless of case. @param query char[] of the query statement @param offset position of query to start checking @return boolean indicates presence of word
[ "Parse", "string", "to", "check", "presence", "of", "MOVE", "keyword", "regardless", "of", "case", "." ]
train
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/Parser.java#L602-L611
UrielCh/ovh-java-sdk
ovh-java-sdk-horizonView/src/main/java/net/minidev/ovh/api/ApiOvhHorizonView.java
ApiOvhHorizonView.serviceName_domainTrust_domainTrustId_addDomainUserOnComposer_POST
public OvhTask serviceName_domainTrust_domainTrustId_addDomainUserOnComposer_POST(String serviceName, Long domainTrustId, String domain, String password, String username) throws IOException { """ Add a domain user to add your desktop in your Active Directory REST: POST /horizonView/{serviceName}/domainTrust/{do...
java
public OvhTask serviceName_domainTrust_domainTrustId_addDomainUserOnComposer_POST(String serviceName, Long domainTrustId, String domain, String password, String username) throws IOException { String qPath = "/horizonView/{serviceName}/domainTrust/{domainTrustId}/addDomainUserOnComposer"; StringBuilder sb = path(qPa...
[ "public", "OvhTask", "serviceName_domainTrust_domainTrustId_addDomainUserOnComposer_POST", "(", "String", "serviceName", ",", "Long", "domainTrustId", ",", "String", "domain", ",", "String", "password", ",", "String", "username", ")", "throws", "IOException", "{", "String...
Add a domain user to add your desktop in your Active Directory REST: POST /horizonView/{serviceName}/domainTrust/{domainTrustId}/addDomainUserOnComposer @param password [required] Password of the user @param domain [required] Name of your Domain (example : domain.local) @param username [required] Name of the User who ...
[ "Add", "a", "domain", "user", "to", "add", "your", "desktop", "in", "your", "Active", "Directory" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-horizonView/src/main/java/net/minidev/ovh/api/ApiOvhHorizonView.java#L314-L323
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacterNameIterator.java
UCharacterNameIterator.setRange
@Override public void setRange(int start, int limit) { """ <p>Restricts the range of integers to iterate and resets the iteration to begin at the index argument start.</p> <p>If setRange(start, end) is not performed before next(element) is called, the iteration will start from the integer index UCharacter....
java
@Override public void setRange(int start, int limit) { if (start >= limit) { throw new IllegalArgumentException( "start or limit has to be valid Unicode codepoints and start < limit"); } if (start < UCharacter.MIN_VALUE) { m_start_ = UCharacter.MIN...
[ "@", "Override", "public", "void", "setRange", "(", "int", "start", ",", "int", "limit", ")", "{", "if", "(", "start", ">=", "limit", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"start or limit has to be valid Unicode codepoints and start < limit\"", ...
<p>Restricts the range of integers to iterate and resets the iteration to begin at the index argument start.</p> <p>If setRange(start, end) is not performed before next(element) is called, the iteration will start from the integer index UCharacter.MIN_VALUE and end at UCharacter.MAX_VALUE.</p> <p> If this range is set ...
[ "<p", ">", "Restricts", "the", "range", "of", "integers", "to", "iterate", "and", "resets", "the", "iteration", "to", "begin", "at", "the", "index", "argument", "start", ".", "<", "/", "p", ">", "<p", ">", "If", "setRange", "(", "start", "end", ")", ...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacterNameIterator.java#L143-L164
jmurty/java-xmlbuilder
src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
BaseXMLBuilder.namespaceImpl
protected void namespaceImpl(String prefix, String namespaceURI) { """ Add an XML namespace attribute to this builder's element node. @param prefix a prefix for the namespace URI within the document, may be null or empty in which case a default "xmlns" attribute is created. @param namespaceURI a namespace u...
java
protected void namespaceImpl(String prefix, String namespaceURI) { if (! (this.xmlNode instanceof Element)) { throw new RuntimeException( "Cannot add an attribute to non-Element underlying node: " + this.xmlNode); } if (prefix != null && prefix.length(...
[ "protected", "void", "namespaceImpl", "(", "String", "prefix", ",", "String", "namespaceURI", ")", "{", "if", "(", "!", "(", "this", ".", "xmlNode", "instanceof", "Element", ")", ")", "{", "throw", "new", "RuntimeException", "(", "\"Cannot add an attribute to no...
Add an XML namespace attribute to this builder's element node. @param prefix a prefix for the namespace URI within the document, may be null or empty in which case a default "xmlns" attribute is created. @param namespaceURI a namespace uri
[ "Add", "an", "XML", "namespace", "attribute", "to", "this", "builder", "s", "element", "node", "." ]
train
https://github.com/jmurty/java-xmlbuilder/blob/7c224b8e8ed79808509322cb141dab5a88dd3cec/src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java#L918-L931
knowm/XChange
xchange-exx/src/main/java/org/knowm/xchange/exx/utils/AuthUtils.java
AuthUtils.getBasicAuth
public static String getBasicAuth(String user, final String pass) { """ Generates a BASE64 Basic Authentication String @return BASE64 Basic Authentication String """ return "Basic " + java.util.Base64.getEncoder().encodeToString((user + ":" + pass).getBytes()); }
java
public static String getBasicAuth(String user, final String pass) { return "Basic " + java.util.Base64.getEncoder().encodeToString((user + ":" + pass).getBytes()); }
[ "public", "static", "String", "getBasicAuth", "(", "String", "user", ",", "final", "String", "pass", ")", "{", "return", "\"Basic \"", "+", "java", ".", "util", ".", "Base64", ".", "getEncoder", "(", ")", ".", "encodeToString", "(", "(", "user", "+", "\"...
Generates a BASE64 Basic Authentication String @return BASE64 Basic Authentication String
[ "Generates", "a", "BASE64", "Basic", "Authentication", "String" ]
train
https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-exx/src/main/java/org/knowm/xchange/exx/utils/AuthUtils.java#L17-L20
jeremybrooks/jinx
src/main/java/net/jeremybrooks/jinx/api/PhotosApi.java
PhotosApi.setContentType
public Response setContentType(String photoId, JinxConstants.ContentType contentType) throws JinxException { """ Set the content type of a photo. <br> This method requires authentication with 'write' permission. @param photoId Required. The id of the photo to set the content of. @param contentType Requir...
java
public Response setContentType(String photoId, JinxConstants.ContentType contentType) throws JinxException { JinxUtils.validateParams(photoId, contentType); Map<String, String> params = new TreeMap<>(); params.put("method", "flickr.photos.setContentType"); params.put("photo_id", photoId); params.put...
[ "public", "Response", "setContentType", "(", "String", "photoId", ",", "JinxConstants", ".", "ContentType", "contentType", ")", "throws", "JinxException", "{", "JinxUtils", ".", "validateParams", "(", "photoId", ",", "contentType", ")", ";", "Map", "<", "String", ...
Set the content type of a photo. <br> This method requires authentication with 'write' permission. @param photoId Required. The id of the photo to set the content of. @param contentType Required. Content type of the photo. @return response object with the result of the requested operation. @throws JinxException if...
[ "Set", "the", "content", "type", "of", "a", "photo", ".", "<br", ">", "This", "method", "requires", "authentication", "with", "write", "permission", "." ]
train
https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/PhotosApi.java#L886-L893
m-m-m/util
value/src/main/java/net/sf/mmm/util/value/base/StringValueConverterImpl.java
StringValueConverterImpl.convertUnknownValue
protected <V> V convertUnknownValue(String value, Class<V> type, Object valueSource) throws ValueNotSetException, WrongValueTypeException { """ This method converts the given {@link String}-{@code value} to the given {@code type}. It is called from {@link #convertValue(String, Object, Class, Type)} if the given {...
java
protected <V> V convertUnknownValue(String value, Class<V> type, Object valueSource) throws ValueNotSetException, WrongValueTypeException { // throw new UnknownValueType(); throw new WrongValueTypeException(value, valueSource, type); }
[ "protected", "<", "V", ">", "V", "convertUnknownValue", "(", "String", "value", ",", "Class", "<", "V", ">", "type", ",", "Object", "valueSource", ")", "throws", "ValueNotSetException", ",", "WrongValueTypeException", "{", "// throw new UnknownValueType();", "throw"...
This method converts the given {@link String}-{@code value} to the given {@code type}. It is called from {@link #convertValue(String, Object, Class, Type)} if the given {@code type} is unknown. This default implementation simply throws a new {@link WrongValueTypeException}. You can extend this class and override this m...
[ "This", "method", "converts", "the", "given", "{", "@link", "String", "}", "-", "{", "@code", "value", "}", "to", "the", "given", "{", "@code", "type", "}", ".", "It", "is", "called", "from", "{", "@link", "#convertValue", "(", "String", "Object", "Cla...
train
https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/value/src/main/java/net/sf/mmm/util/value/base/StringValueConverterImpl.java#L202-L206
geomajas/geomajas-project-client-gwt2
plugin/wms/wms/src/main/java/org/geomajas/gwt2/plugin/wms/client/WmsClient.java
WmsClient.createLayer
public WmsLayer createLayer(String title, String crs, TileConfiguration tileConfig, WmsLayerConfiguration layerConfig, WmsLayerInfo layerInfo) { """ Create a new WMS layer. This layer does not support a GetFeatureInfo call! If you need that, you'll have to use the server extension of this plug-in. @par...
java
public WmsLayer createLayer(String title, String crs, TileConfiguration tileConfig, WmsLayerConfiguration layerConfig, WmsLayerInfo layerInfo) { if (layerInfo == null || layerInfo.isQueryable()) { return new FeatureInfoSupportedWmsLayer(title, crs, layerConfig, tileConfig, layerInfo); } else { return ...
[ "public", "WmsLayer", "createLayer", "(", "String", "title", ",", "String", "crs", ",", "TileConfiguration", "tileConfig", ",", "WmsLayerConfiguration", "layerConfig", ",", "WmsLayerInfo", "layerInfo", ")", "{", "if", "(", "layerInfo", "==", "null", "||", "layerIn...
Create a new WMS layer. This layer does not support a GetFeatureInfo call! If you need that, you'll have to use the server extension of this plug-in. @param title The layer title. @param crs The CRS for this layer. @param tileConfig The tile configuration object. @param layerConfig The layer configurati...
[ "Create", "a", "new", "WMS", "layer", ".", "This", "layer", "does", "not", "support", "a", "GetFeatureInfo", "call!", "If", "you", "need", "that", "you", "ll", "have", "to", "use", "the", "server", "extension", "of", "this", "plug", "-", "in", "." ]
train
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/wms/wms/src/main/java/org/geomajas/gwt2/plugin/wms/client/WmsClient.java#L94-L101
lingochamp/okdownload
okdownload/src/main/java/com/liulishuo/okdownload/core/breakpoint/BreakpointInfo.java
BreakpointInfo.copyWithReplaceIdAndUrl
public BreakpointInfo copyWithReplaceIdAndUrl(int replaceId, String newUrl) { """ You can use this method to replace url for using breakpoint info from another task. """ final BreakpointInfo info = new BreakpointInfo(replaceId, newUrl, parentFile, filenameHolder.get(), taskOnlyProvidedP...
java
public BreakpointInfo copyWithReplaceIdAndUrl(int replaceId, String newUrl) { final BreakpointInfo info = new BreakpointInfo(replaceId, newUrl, parentFile, filenameHolder.get(), taskOnlyProvidedParentPath); info.chunked = this.chunked; for (BlockInfo blockInfo : blockInfoList) { ...
[ "public", "BreakpointInfo", "copyWithReplaceIdAndUrl", "(", "int", "replaceId", ",", "String", "newUrl", ")", "{", "final", "BreakpointInfo", "info", "=", "new", "BreakpointInfo", "(", "replaceId", ",", "newUrl", ",", "parentFile", ",", "filenameHolder", ".", "get...
You can use this method to replace url for using breakpoint info from another task.
[ "You", "can", "use", "this", "method", "to", "replace", "url", "for", "using", "breakpoint", "info", "from", "another", "task", "." ]
train
https://github.com/lingochamp/okdownload/blob/403e2c814556ef7f2fade1f5bee83a02a5eaecb2/okdownload/src/main/java/com/liulishuo/okdownload/core/breakpoint/BreakpointInfo.java#L202-L210
BigBadaboom/androidsvg
androidsvg/src/main/java/com/caverock/androidsvg/SVGAndroidRenderer.java
SVGAndroidRenderer.extractRawText
private void extractRawText(TextContainer parent, StringBuilder str) { """ /* Extract the raw text from a TextContainer. Used by <tref> handler code. """ Iterator<SvgObject> iter = parent.children.iterator(); boolean isFirstChild = true; while (iter.hasNext()) { ...
java
private void extractRawText(TextContainer parent, StringBuilder str) { Iterator<SvgObject> iter = parent.children.iterator(); boolean isFirstChild = true; while (iter.hasNext()) { SvgObject child = iter.next(); if (child instanceof TextContainer) {...
[ "private", "void", "extractRawText", "(", "TextContainer", "parent", ",", "StringBuilder", "str", ")", "{", "Iterator", "<", "SvgObject", ">", "iter", "=", "parent", ".", "children", ".", "iterator", "(", ")", ";", "boolean", "isFirstChild", "=", "true", ";"...
/* Extract the raw text from a TextContainer. Used by <tref> handler code.
[ "/", "*", "Extract", "the", "raw", "text", "from", "a", "TextContainer", ".", "Used", "by", "<tref", ">", "handler", "code", "." ]
train
https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVGAndroidRenderer.java#L1816-L1832
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/script/common/ImplicitObjectUtil.java
ImplicitObjectUtil.loadActionForm
public static void loadActionForm(JspContext jspContext, Object form) { """ Load the given <code>form</code> into the {@link JspContext} object. Because the framework supports any bean action forms, the type of the form is {@link Object} @param jspContext the jsp context @param form the form object """ ...
java
public static void loadActionForm(JspContext jspContext, Object form) { jspContext.setAttribute(ACTION_FORM_IMPLICIT_OBJECT_KEY, unwrapForm(form)); }
[ "public", "static", "void", "loadActionForm", "(", "JspContext", "jspContext", ",", "Object", "form", ")", "{", "jspContext", ".", "setAttribute", "(", "ACTION_FORM_IMPLICIT_OBJECT_KEY", ",", "unwrapForm", "(", "form", ")", ")", ";", "}" ]
Load the given <code>form</code> into the {@link JspContext} object. Because the framework supports any bean action forms, the type of the form is {@link Object} @param jspContext the jsp context @param form the form object
[ "Load", "the", "given", "<code", ">", "form<", "/", "code", ">", "into", "the", "{" ]
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/script/common/ImplicitObjectUtil.java#L87-L89
mbrade/prefixedproperties
pp-spring/src/main/java/net/sf/prefixedproperties/spring/PrefixedPropertiesPersister.java
PrefixedPropertiesPersister.loadFromJson
public void loadFromJson(final Properties props, final InputStream is) throws IOException { """ Loads from json. @param props the props @param is the is @throws IOException Signals that an I/O exception has occurred. """ try { ((PrefixedProperties) props).loadFromJSON(is); } catch (final NoSuchM...
java
public void loadFromJson(final Properties props, final InputStream is) throws IOException { try { ((PrefixedProperties) props).loadFromJSON(is); } catch (final NoSuchMethodError err) { throw new IOException( "Cannot load properties JSON file - not using PrefixedProperties: " + err.getMessage()); } }
[ "public", "void", "loadFromJson", "(", "final", "Properties", "props", ",", "final", "InputStream", "is", ")", "throws", "IOException", "{", "try", "{", "(", "(", "PrefixedProperties", ")", "props", ")", ".", "loadFromJSON", "(", "is", ")", ";", "}", "catc...
Loads from json. @param props the props @param is the is @throws IOException Signals that an I/O exception has occurred.
[ "Loads", "from", "json", "." ]
train
https://github.com/mbrade/prefixedproperties/blob/ac430409ea37e244158002b3cf1504417835a0b2/pp-spring/src/main/java/net/sf/prefixedproperties/spring/PrefixedPropertiesPersister.java#L53-L60
nguillaumin/slick2d-maven
slick2d-core/src/main/java/org/newdawn/slick/util/xml/ObjectTreeParser.java
ObjectTreeParser.findMethod
private Method findMethod(Class clazz, String name) { """ Find a method in a class by it's name. Note that this method is only needed because the general reflection method is case sensitive @param clazz The clazz to search @param name The name of the method to search for @return The method or null if none c...
java
private Method findMethod(Class clazz, String name) { Method[] methods = clazz.getDeclaredMethods(); for (int i=0;i<methods.length;i++) { if (methods[i].getName().equalsIgnoreCase(name)) { Method method = methods[i]; Class[] params = method.getParameterTypes(); if (params.length == 1) { ...
[ "private", "Method", "findMethod", "(", "Class", "clazz", ",", "String", "name", ")", "{", "Method", "[", "]", "methods", "=", "clazz", ".", "getDeclaredMethods", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "methods", ".", "length...
Find a method in a class by it's name. Note that this method is only needed because the general reflection method is case sensitive @param clazz The clazz to search @param name The name of the method to search for @return The method or null if none could be located
[ "Find", "a", "method", "in", "a", "class", "by", "it", "s", "name", ".", "Note", "that", "this", "method", "is", "only", "needed", "because", "the", "general", "reflection", "method", "is", "case", "sensitive" ]
train
https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/util/xml/ObjectTreeParser.java#L379-L393
jmapper-framework/jmapper-core
JMapper Framework/src/main/java/com/googlecode/jmapper/operations/NestedMappingHandler.java
NestedMappingHandler.checkGetAccessor
private static MappedField checkGetAccessor(XML xml, Class<?> aClass, Field nestedField) { """ Checks only get accessor of this field. @param xml used to check xml configuration @param aClass class where is the field with the nested mapping @param nestedField field with nested mapping """ MappedField...
java
private static MappedField checkGetAccessor(XML xml, Class<?> aClass, Field nestedField){ MappedField field = new MappedField(nestedField); xml.fillMappedField(aClass, field); Annotation.fillMappedField(aClass,field); verifyGetterMethods(aClass,field); return field; }
[ "private", "static", "MappedField", "checkGetAccessor", "(", "XML", "xml", ",", "Class", "<", "?", ">", "aClass", ",", "Field", "nestedField", ")", "{", "MappedField", "field", "=", "new", "MappedField", "(", "nestedField", ")", ";", "xml", ".", "fillMappedF...
Checks only get accessor of this field. @param xml used to check xml configuration @param aClass class where is the field with the nested mapping @param nestedField field with nested mapping
[ "Checks", "only", "get", "accessor", "of", "this", "field", "." ]
train
https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/operations/NestedMappingHandler.java#L95-L102
icode/ameba
src/main/java/ameba/db/ebean/support/ModelResourceStructure.java
ModelResourceStructure.executeTx
protected <O> O executeTx(TxCallable<O> c) throws Exception { """ <p>executeTx.</p> @param c a {@link ameba.db.ebean.support.ModelResourceStructure.TxCallable} object. @param <O> a O object. @return a O object. @throws java.lang.Exception if any. """ return executeTx(c, null); }
java
protected <O> O executeTx(TxCallable<O> c) throws Exception { return executeTx(c, null); }
[ "protected", "<", "O", ">", "O", "executeTx", "(", "TxCallable", "<", "O", ">", "c", ")", "throws", "Exception", "{", "return", "executeTx", "(", "c", ",", "null", ")", ";", "}" ]
<p>executeTx.</p> @param c a {@link ameba.db.ebean.support.ModelResourceStructure.TxCallable} object. @param <O> a O object. @return a O object. @throws java.lang.Exception if any.
[ "<p", ">", "executeTx", ".", "<", "/", "p", ">" ]
train
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/db/ebean/support/ModelResourceStructure.java#L1143-L1145
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/trees/EnglishGrammaticalRelations.java
EnglishGrammaticalRelations.getConj
public static GrammaticalRelation getConj(String conjunctionString) { """ The "conj" grammatical relation. Used to collapse conjunct relations. They will be turned into conj_word, where "word" is a conjunction. NOTE: Because these relations lack associated GrammaticalRelationAnnotations, they cannot be arcs o...
java
public static GrammaticalRelation getConj(String conjunctionString) { GrammaticalRelation result = conjs.get(conjunctionString); if (result == null) { synchronized(conjs) { result = conjs.get(conjunctionString); if (result == null) { result = new GrammaticalRelation(Languag...
[ "public", "static", "GrammaticalRelation", "getConj", "(", "String", "conjunctionString", ")", "{", "GrammaticalRelation", "result", "=", "conjs", ".", "get", "(", "conjunctionString", ")", ";", "if", "(", "result", "==", "null", ")", "{", "synchronized", "(", ...
The "conj" grammatical relation. Used to collapse conjunct relations. They will be turned into conj_word, where "word" is a conjunction. NOTE: Because these relations lack associated GrammaticalRelationAnnotations, they cannot be arcs of a TreeGraphNode. @param conjunctionString The conjunction to make a GrammaticalR...
[ "The", "conj", "grammatical", "relation", ".", "Used", "to", "collapse", "conjunct", "relations", ".", "They", "will", "be", "turned", "into", "conj_word", "where", "word", "is", "a", "conjunction", "." ]
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/trees/EnglishGrammaticalRelations.java#L1589-L1602
EdwardRaff/JSAT
JSAT/src/jsat/classifiers/trees/DecisionStump.java
DecisionStump.getGain
protected double getGain(ImpurityScore origScore, ClassificationDataSet source, List<IntList> aSplit) { """ From the score for the original set that is being split, this computes the gain as the improvement in classification from the original split. @param origScore the score of the unsplit set @param source @...
java
protected double getGain(ImpurityScore origScore, ClassificationDataSet source, List<IntList> aSplit) { ImpurityScore[] scores = getSplitScores(source, aSplit); return ImpurityScore.gain(origScore, scores); }
[ "protected", "double", "getGain", "(", "ImpurityScore", "origScore", ",", "ClassificationDataSet", "source", ",", "List", "<", "IntList", ">", "aSplit", ")", "{", "ImpurityScore", "[", "]", "scores", "=", "getSplitScores", "(", "source", ",", "aSplit", ")", ";...
From the score for the original set that is being split, this computes the gain as the improvement in classification from the original split. @param origScore the score of the unsplit set @param source @param aSplit the splitting of the data points @return the gain score for this split
[ "From", "the", "score", "for", "the", "original", "set", "that", "is", "being", "split", "this", "computes", "the", "gain", "as", "the", "improvement", "in", "classification", "from", "the", "original", "split", "." ]
train
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/trees/DecisionStump.java#L233-L239
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/db/entitymanager/DbEntityManager.java
DbEntityManager.hasOptimisticLockingException
private DbOperation hasOptimisticLockingException(List<DbOperation> operationsToFlush, Throwable cause) { """ An OptimisticLockingException check for batch processing @param operationsToFlush The list of DB operations in which the Exception occurred @param cause the Exception object @return The DbOperation wh...
java
private DbOperation hasOptimisticLockingException(List<DbOperation> operationsToFlush, Throwable cause) { BatchExecutorException batchExecutorException = ExceptionUtil.findBatchExecutorException(cause); if (batchExecutorException != null) { int failedOperationIndex = batchExecutorException.getSuccessfu...
[ "private", "DbOperation", "hasOptimisticLockingException", "(", "List", "<", "DbOperation", ">", "operationsToFlush", ",", "Throwable", "cause", ")", "{", "BatchExecutorException", "batchExecutorException", "=", "ExceptionUtil", ".", "findBatchExecutorException", "(", "caus...
An OptimisticLockingException check for batch processing @param operationsToFlush The list of DB operations in which the Exception occurred @param cause the Exception object @return The DbOperation where the OptimisticLockingException has occurred or null if no OptimisticLockingException occurred
[ "An", "OptimisticLockingException", "check", "for", "batch", "processing" ]
train
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/db/entitymanager/DbEntityManager.java#L379-L395
netscaler/sdx_nitro
src/main/java/com/citrix/sdx/nitro/resource/config/mps/traceroute.java
traceroute.get_nitro_bulk_response
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { """ <pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre> """ traceroute_responses result = (traceroute_responses) service.get_payloa...
java
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { traceroute_responses result = (traceroute_responses) service.get_payload_formatter().string_to_resource(traceroute_responses.class, response); if(result.errorcode != 0) { if (result.errorcode == S...
[ "protected", "base_resource", "[", "]", "get_nitro_bulk_response", "(", "nitro_service", "service", ",", "String", "response", ")", "throws", "Exception", "{", "traceroute_responses", "result", "=", "(", "traceroute_responses", ")", "service", ".", "get_payload_formatte...
<pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre>
[ "<pre", ">", "Converts", "API", "response", "of", "bulk", "operation", "into", "object", "and", "returns", "the", "object", "array", "in", "case", "of", "get", "request", ".", "<", "/", "pre", ">" ]
train
https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/traceroute.java#L203-L220
aws/aws-sdk-java
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/Put.java
Put.withExpressionAttributeNames
public Put withExpressionAttributeNames(java.util.Map<String, String> expressionAttributeNames) { """ <p> One or more substitution tokens for attribute names in an expression. </p> @param expressionAttributeNames One or more substitution tokens for attribute names in an expression. @return Returns a referen...
java
public Put withExpressionAttributeNames(java.util.Map<String, String> expressionAttributeNames) { setExpressionAttributeNames(expressionAttributeNames); return this; }
[ "public", "Put", "withExpressionAttributeNames", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "expressionAttributeNames", ")", "{", "setExpressionAttributeNames", "(", "expressionAttributeNames", ")", ";", "return", "this", ";", "}" ]
<p> One or more substitution tokens for attribute names in an expression. </p> @param expressionAttributeNames One or more substitution tokens for attribute names in an expression. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "One", "or", "more", "substitution", "tokens", "for", "attribute", "names", "in", "an", "expression", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/Put.java#L265-L268
pip-services3-java/pip-services3-commons-java
src/org/pipservices3/commons/refer/References.java
References.getOptional
public <T> List<T> getOptional(Class<T> type, Object locator) { """ Gets all component references that match specified locator and matching to the specified type. @param type the Class type that defined the type of the result. @param locator the locator to find references by. @return a list with matching ...
java
public <T> List<T> getOptional(Class<T> type, Object locator) { try { return find(type, locator, false); } catch (Exception ex) { return new ArrayList<T>(); } }
[ "public", "<", "T", ">", "List", "<", "T", ">", "getOptional", "(", "Class", "<", "T", ">", "type", ",", "Object", "locator", ")", "{", "try", "{", "return", "find", "(", "type", ",", "locator", ",", "false", ")", ";", "}", "catch", "(", "Excepti...
Gets all component references that match specified locator and matching to the specified type. @param type the Class type that defined the type of the result. @param locator the locator to find references by. @return a list with matching component references or empty list if nothing was found.
[ "Gets", "all", "component", "references", "that", "match", "specified", "locator", "and", "matching", "to", "the", "specified", "type", "." ]
train
https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/refer/References.java#L243-L249
amaembo/streamex
src/main/java/one/util/streamex/DoubleStreamEx.java
DoubleStreamEx.mapLast
public DoubleStreamEx mapLast(DoubleUnaryOperator mapper) { """ Returns a stream where the last element is the replaced with the result of applying the given function while the other elements are left intact. <p> This is a <a href="package-summary.html#StreamOps">quasi-intermediate operation</a>. <p> The...
java
public DoubleStreamEx mapLast(DoubleUnaryOperator mapper) { return delegate(new PairSpliterator.PSOfDouble((a, b) -> a, mapper, spliterator(), PairSpliterator.MODE_MAP_LAST)); }
[ "public", "DoubleStreamEx", "mapLast", "(", "DoubleUnaryOperator", "mapper", ")", "{", "return", "delegate", "(", "new", "PairSpliterator", ".", "PSOfDouble", "(", "(", "a", ",", "b", ")", "->", "a", ",", "mapper", ",", "spliterator", "(", ")", ",", "PairS...
Returns a stream where the last element is the replaced with the result of applying the given function while the other elements are left intact. <p> This is a <a href="package-summary.html#StreamOps">quasi-intermediate operation</a>. <p> The mapper function is called at most once. It could be not called at all if the...
[ "Returns", "a", "stream", "where", "the", "last", "element", "is", "the", "replaced", "with", "the", "result", "of", "applying", "the", "given", "function", "while", "the", "other", "elements", "are", "left", "intact", "." ]
train
https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/DoubleStreamEx.java#L190-L193
mahjong4j/mahjong4j
src/main/java/org/mahjong4j/hands/Shuntsu.java
Shuntsu.check
public static boolean check(Tile tile1, Tile tile2, Tile tile3) { """ 順子かどうかの判定を行ないます @param tile1 1枚目 @param tile2 2枚目 @param tile3 3枚目 @return 順子であればtrue 順子でなければfalse """ //Typeが違う場合false if (tile1.getType() != tile2.getType() || tile2.getType() != tile3.getType()) { return...
java
public static boolean check(Tile tile1, Tile tile2, Tile tile3) { //Typeが違う場合false if (tile1.getType() != tile2.getType() || tile2.getType() != tile3.getType()) { return false; } //字牌だった場合false if (tile1.getNumber() == 0 || tile2.getNumber() == 0 || tile3.getNumber(...
[ "public", "static", "boolean", "check", "(", "Tile", "tile1", ",", "Tile", "tile2", ",", "Tile", "tile3", ")", "{", "//Typeが違う場合false", "if", "(", "tile1", ".", "getType", "(", ")", "!=", "tile2", ".", "getType", "(", ")", "||", "tile2", ".", "getType"...
順子かどうかの判定を行ないます @param tile1 1枚目 @param tile2 2枚目 @param tile3 3枚目 @return 順子であればtrue 順子でなければfalse
[ "順子かどうかの判定を行ないます" ]
train
https://github.com/mahjong4j/mahjong4j/blob/caa75963286b631ad51953d0d8c71cf6bf79b8f4/src/main/java/org/mahjong4j/hands/Shuntsu.java#L68-L100
googleapis/google-cloud-java
google-cloud-clients/google-cloud-talent/src/main/java/com/google/cloud/talent/v4beta1/CompanyServiceClient.java
CompanyServiceClient.createCompany
public final Company createCompany(TenantOrProjectName parent, Company company) { """ Creates a new company entity. <p>Sample code: <pre><code> try (CompanyServiceClient companyServiceClient = CompanyServiceClient.create()) { TenantOrProjectName parent = TenantName.of("[PROJECT]", "[TENANT]"); Company com...
java
public final Company createCompany(TenantOrProjectName parent, Company company) { CreateCompanyRequest request = CreateCompanyRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .setCompany(company) .build(); return createCompany(request); }
[ "public", "final", "Company", "createCompany", "(", "TenantOrProjectName", "parent", ",", "Company", "company", ")", "{", "CreateCompanyRequest", "request", "=", "CreateCompanyRequest", ".", "newBuilder", "(", ")", ".", "setParent", "(", "parent", "==", "null", "?...
Creates a new company entity. <p>Sample code: <pre><code> try (CompanyServiceClient companyServiceClient = CompanyServiceClient.create()) { TenantOrProjectName parent = TenantName.of("[PROJECT]", "[TENANT]"); Company company = Company.newBuilder().build(); Company response = companyServiceClient.createCompany(parent,...
[ "Creates", "a", "new", "company", "entity", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-talent/src/main/java/com/google/cloud/talent/v4beta1/CompanyServiceClient.java#L182-L190
msgpack/msgpack-java
msgpack-core/src/main/java/org/msgpack/core/MessagePacker.java
MessagePacker.addPayload
public MessagePacker addPayload(byte[] src, int off, int len) throws IOException { """ Writes a byte array to the output. <p> This method is used with {@link #packRawStringHeader(int)} or {@link #packBinaryHeader(int)} methods. <p> Unlike {@link #writePayload(byte[], int, int)} method, this method ...
java
public MessagePacker addPayload(byte[] src, int off, int len) throws IOException { if (buffer == null || buffer.size() - position < len || len > bufferFlushThreshold) { flush(); // call flush before add // Directly add the payload without using the buffer out...
[ "public", "MessagePacker", "addPayload", "(", "byte", "[", "]", "src", ",", "int", "off", ",", "int", "len", ")", "throws", "IOException", "{", "if", "(", "buffer", "==", "null", "||", "buffer", ".", "size", "(", ")", "-", "position", "<", "len", "||...
Writes a byte array to the output. <p> This method is used with {@link #packRawStringHeader(int)} or {@link #packBinaryHeader(int)} methods. <p> Unlike {@link #writePayload(byte[], int, int)} method, this method does not make a defensive copy of the given byte array, even if it is shorter than {@link MessagePack.Packer...
[ "Writes", "a", "byte", "array", "to", "the", "output", ".", "<p", ">", "This", "method", "is", "used", "with", "{", "@link", "#packRawStringHeader", "(", "int", ")", "}", "or", "{", "@link", "#packBinaryHeader", "(", "int", ")", "}", "methods", ".", "<...
train
https://github.com/msgpack/msgpack-java/blob/16e370e348215a72a14c210b42d448d513aee015/msgpack-core/src/main/java/org/msgpack/core/MessagePacker.java#L1063-L1077
geomajas/geomajas-project-client-gwt2
impl/src/main/java/org/geomajas/gwt2/client/gfx/VectorTileObject.java
VectorTileObject.setInnerSvg
public static void setInnerSvg(Element element, String svg) { """ Similar method to the "setInnerHTML", but specified for setting SVG. Using the regular setInnerHTML, it is not possible to set a string of SVG on an object. This method can do that. On the other hand, this method is better not used for setting nor...
java
public static void setInnerSvg(Element element, String svg) { if (Dom.isFireFox()) { setFireFoxInnerHTML(element, "<g xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">" + svg + "</g>"); } else if (Dom.isWebkit()) { setWebkitInnerHTML(element, "<g xmlns=\"http:...
[ "public", "static", "void", "setInnerSvg", "(", "Element", "element", ",", "String", "svg", ")", "{", "if", "(", "Dom", ".", "isFireFox", "(", ")", ")", "{", "setFireFoxInnerHTML", "(", "element", ",", "\"<g xmlns=\\\"http://www.w3.org/2000/svg\\\" xmlns:xlink=\\\"h...
Similar method to the "setInnerHTML", but specified for setting SVG. Using the regular setInnerHTML, it is not possible to set a string of SVG on an object. This method can do that. On the other hand, this method is better not used for setting normal HTML as an element's innerHTML. @param element The element onto whic...
[ "Similar", "method", "to", "the", "setInnerHTML", "but", "specified", "for", "setting", "SVG", ".", "Using", "the", "regular", "setInnerHTML", "it", "is", "not", "possible", "to", "set", "a", "string", "of", "SVG", "on", "an", "object", ".", "This", "metho...
train
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/impl/src/main/java/org/geomajas/gwt2/client/gfx/VectorTileObject.java#L59-L69
apache/groovy
src/main/java/org/codehaus/groovy/runtime/typehandling/NumberMath.java
NumberMath.rightShift
public static Number rightShift(Number left, Number right) { """ For this operation, consider the operands independently. Throw an exception if the right operand (shift distance) is not an integral type. For the left operand (shift value) also require an integral type, but do NOT promote from Integer to Long. ...
java
public static Number rightShift(Number left, Number right) { if (isFloatingPoint(right) || isBigDecimal(right)) { throw new UnsupportedOperationException("Shift distance must be an integral type, but " + right + " (" + right.getClass().getName() + ") was supplied"); } return getMath(...
[ "public", "static", "Number", "rightShift", "(", "Number", "left", ",", "Number", "right", ")", "{", "if", "(", "isFloatingPoint", "(", "right", ")", "||", "isBigDecimal", "(", "right", ")", ")", "{", "throw", "new", "UnsupportedOperationException", "(", "\"...
For this operation, consider the operands independently. Throw an exception if the right operand (shift distance) is not an integral type. For the left operand (shift value) also require an integral type, but do NOT promote from Integer to Long. This is consistent with Java, and makes sense for the shift operators.
[ "For", "this", "operation", "consider", "the", "operands", "independently", ".", "Throw", "an", "exception", "if", "the", "right", "operand", "(", "shift", "distance", ")", "is", "not", "an", "integral", "type", ".", "For", "the", "left", "operand", "(", "...
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/typehandling/NumberMath.java#L110-L115
spring-projects/spring-security-oauth
spring-security-oauth2/src/main/java/org/springframework/security/oauth2/common/util/OAuth2Utils.java
OAuth2Utils.containsAll
public static boolean containsAll(Set<String> target, Set<String> members) { """ Compare 2 sets and check that one contains all members of the other. @param target set of strings to check @param members the members to compare to @return true if all members are in the target """ target = new HashSet<Stri...
java
public static boolean containsAll(Set<String> target, Set<String> members) { target = new HashSet<String>(target); target.retainAll(members); return target.size() == members.size(); }
[ "public", "static", "boolean", "containsAll", "(", "Set", "<", "String", ">", "target", ",", "Set", "<", "String", ">", "members", ")", "{", "target", "=", "new", "HashSet", "<", "String", ">", "(", "target", ")", ";", "target", ".", "retainAll", "(", ...
Compare 2 sets and check that one contains all members of the other. @param target set of strings to check @param members the members to compare to @return true if all members are in the target
[ "Compare", "2", "sets", "and", "check", "that", "one", "contains", "all", "members", "of", "the", "other", "." ]
train
https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/common/util/OAuth2Utils.java#L126-L130
looly/hutool
hutool-db/src/main/java/cn/hutool/db/sql/SqlBuilder.java
SqlBuilder.insert
public SqlBuilder insert(Entity entity, DialectName dialectName) { """ 插入<br> 插入会忽略空的字段名及其对应值,但是对于有字段名对应值为{@code null}的情况不忽略 @param entity 实体 @param dialectName 方言名 @return 自己 """ // 验证 validateEntity(entity); if (null != wrapper) { // 包装表名 // entity = wrapper.wrap(entity); entity....
java
public SqlBuilder insert(Entity entity, DialectName dialectName) { // 验证 validateEntity(entity); if (null != wrapper) { // 包装表名 // entity = wrapper.wrap(entity); entity.setTableName(wrapper.wrap(entity.getTableName())); } final boolean isOracle = ObjectUtil.equal(dialectName, DialectName....
[ "public", "SqlBuilder", "insert", "(", "Entity", "entity", ",", "DialectName", "dialectName", ")", "{", "// 验证\r", "validateEntity", "(", "entity", ")", ";", "if", "(", "null", "!=", "wrapper", ")", "{", "// 包装表名\r", "// entity = wrapper.wrap(entity);\r", "entity"...
插入<br> 插入会忽略空的字段名及其对应值,但是对于有字段名对应值为{@code null}的情况不忽略 @param entity 实体 @param dialectName 方言名 @return 自己
[ "插入<br", ">", "插入会忽略空的字段名及其对应值,但是对于有字段名对应值为", "{", "@code", "null", "}", "的情况不忽略" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/SqlBuilder.java#L106-L151
forge/core
javaee/impl/src/main/java/org/jboss/forge/addon/javaee/cdi/CDIOperations.java
CDIOperations.getProjectInjectionPointBeans
public List<JavaResource> getProjectInjectionPointBeans(Project project) { """ Returns all the objects from the given {@link Project} that support injection point. Most of the Java EE components can use @Inject, except most of the JPA artifacts (entities, embeddable...) """ final List<JavaResource> bean...
java
public List<JavaResource> getProjectInjectionPointBeans(Project project) { final List<JavaResource> beans = new ArrayList<>(); if (project != null) { project.getFacet(JavaSourceFacet.class).visitJavaSources(new JavaResourceVisitor() { @Override public void ...
[ "public", "List", "<", "JavaResource", ">", "getProjectInjectionPointBeans", "(", "Project", "project", ")", "{", "final", "List", "<", "JavaResource", ">", "beans", "=", "new", "ArrayList", "<>", "(", ")", ";", "if", "(", "project", "!=", "null", ")", "{"...
Returns all the objects from the given {@link Project} that support injection point. Most of the Java EE components can use @Inject, except most of the JPA artifacts (entities, embeddable...)
[ "Returns", "all", "the", "objects", "from", "the", "given", "{" ]
train
https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/javaee/impl/src/main/java/org/jboss/forge/addon/javaee/cdi/CDIOperations.java#L109-L142
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/misc/CharacterEncoder.java
CharacterEncoder.encodeBuffer
public void encodeBuffer(ByteBuffer aBuffer, OutputStream aStream) throws IOException { """ Encode the <i>aBuffer</i> ByteBuffer and write the encoded result to the OutputStream <i>aStream</i>. <P> The ByteBuffer's position will be advanced to ByteBuffer's limit. """ byte [] buf = getBytes(a...
java
public void encodeBuffer(ByteBuffer aBuffer, OutputStream aStream) throws IOException { byte [] buf = getBytes(aBuffer); encodeBuffer(buf, aStream); }
[ "public", "void", "encodeBuffer", "(", "ByteBuffer", "aBuffer", ",", "OutputStream", "aStream", ")", "throws", "IOException", "{", "byte", "[", "]", "buf", "=", "getBytes", "(", "aBuffer", ")", ";", "encodeBuffer", "(", "buf", ",", "aStream", ")", ";", "}"...
Encode the <i>aBuffer</i> ByteBuffer and write the encoded result to the OutputStream <i>aStream</i>. <P> The ByteBuffer's position will be advanced to ByteBuffer's limit.
[ "Encode", "the", "<i", ">", "aBuffer<", "/", "i", ">", "ByteBuffer", "and", "write", "the", "encoded", "result", "to", "the", "OutputStream", "<i", ">", "aStream<", "/", "i", ">", ".", "<P", ">", "The", "ByteBuffer", "s", "position", "will", "be", "adv...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/misc/CharacterEncoder.java#L337-L341
lessthanoptimal/ddogleg
src/org/ddogleg/solver/PolynomialOps.java
PolynomialOps.cubicRealRoot
public static double cubicRealRoot( double c0 , double c1 , double c2 , double c3 ) { """ Returns a real root to the cubic polynomial: 0 = c0 + c1*x + c2*x^2 + c3*c^3. There can be other real roots. WARNING: This technique is much less stable than using one of the RootFinder algorithms @param c0 Polynomial...
java
public static double cubicRealRoot( double c0 , double c1 , double c2 , double c3 ) { // convert it into this format: r + q*x + p*x^2 + x^3 = 0 double p = c2/c3; double q = c1/c3; double r = c0/c3; // reduce by substitution x = y - p/3 which results in y^3 + a*y + b = 0 double a = (3*q - p*p)/3.0; doub...
[ "public", "static", "double", "cubicRealRoot", "(", "double", "c0", ",", "double", "c1", ",", "double", "c2", ",", "double", "c3", ")", "{", "// convert it into this format: r + q*x + p*x^2 + x^3 = 0", "double", "p", "=", "c2", "/", "c3", ";", "double", "q", ...
Returns a real root to the cubic polynomial: 0 = c0 + c1*x + c2*x^2 + c3*c^3. There can be other real roots. WARNING: This technique is much less stable than using one of the RootFinder algorithms @param c0 Polynomial coefficient for power 0 @param c1 Polynomial coefficient for power 1 @param c2 Polynomial coefficie...
[ "Returns", "a", "real", "root", "to", "the", "cubic", "polynomial", ":", "0", "=", "c0", "+", "c1", "*", "x", "+", "c2", "*", "x^2", "+", "c3", "*", "c^3", ".", "There", "can", "be", "other", "real", "roots", "." ]
train
https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/solver/PolynomialOps.java#L255-L285
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.appendFixedWidthPadRight
public StrBuilder appendFixedWidthPadRight(final int value, final int width, final char padChar) { """ Appends an object to the builder padding on the right to a fixed length. The <code>String.valueOf</code> of the <code>int</code> value is used. If the object is larger than the length, the right hand side is lo...
java
public StrBuilder appendFixedWidthPadRight(final int value, final int width, final char padChar) { return appendFixedWidthPadRight(String.valueOf(value), width, padChar); }
[ "public", "StrBuilder", "appendFixedWidthPadRight", "(", "final", "int", "value", ",", "final", "int", "width", ",", "final", "char", "padChar", ")", "{", "return", "appendFixedWidthPadRight", "(", "String", ".", "valueOf", "(", "value", ")", ",", "width", ","...
Appends an object to the builder padding on the right to a fixed length. The <code>String.valueOf</code> of the <code>int</code> value is used. If the object is larger than the length, the right hand side is lost. @param value the value to append @param width the fixed field width, zero or negative has no effect @pa...
[ "Appends", "an", "object", "to", "the", "builder", "padding", "on", "the", "right", "to", "a", "fixed", "length", ".", "The", "<code", ">", "String", ".", "valueOf<", "/", "code", ">", "of", "the", "<code", ">", "int<", "/", "code", ">", "value", "is...
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L1581-L1583
Erudika/para
para-server/src/main/java/com/erudika/para/security/SecurityUtils.java
SecurityUtils.getSettingForApp
public static String getSettingForApp(App app, String key, String defaultValue) { """ Returns the value of the app setting, read from from app.settings or from the config file if app is root. @param app the app in which to look for these keys @param key setting key @param defaultValue default value @return the...
java
public static String getSettingForApp(App app, String key, String defaultValue) { if (app != null) { Map<String, Object> settings = app.getSettings(); if (settings.containsKey(key)) { return String.valueOf(settings.getOrDefault(key, defaultValue)); } else if (app.isRootApp()) { return Config.getConfi...
[ "public", "static", "String", "getSettingForApp", "(", "App", "app", ",", "String", "key", ",", "String", "defaultValue", ")", "{", "if", "(", "app", "!=", "null", ")", "{", "Map", "<", "String", ",", "Object", ">", "settings", "=", "app", ".", "getSet...
Returns the value of the app setting, read from from app.settings or from the config file if app is root. @param app the app in which to look for these keys @param key setting key @param defaultValue default value @return the value of the configuration property as string
[ "Returns", "the", "value", "of", "the", "app", "setting", "read", "from", "from", "app", ".", "settings", "or", "from", "the", "config", "file", "if", "app", "is", "root", "." ]
train
https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-server/src/main/java/com/erudika/para/security/SecurityUtils.java#L372-L382
dadoonet/fscrawler
framework/src/main/java/fr/pilato/elasticsearch/crawler/fs/framework/FsCrawlerUtil.java
FsCrawlerUtil.isFileSizeUnderLimit
public static boolean isFileSizeUnderLimit(ByteSizeValue limit, long fileSizeAsBytes) { """ Compare if a file size is strictly under a given limit @param limit Limit. If null, we consider that there is no limit and we return true. @param fileSizeAsBytes File size @return true if under the limit. false otherwise...
java
public static boolean isFileSizeUnderLimit(ByteSizeValue limit, long fileSizeAsBytes) { boolean result = true; if (limit != null) { // We check the file size to avoid indexing too big files ByteSizeValue fileSize = new ByteSizeValue(fileSizeAsBytes); int compare = fil...
[ "public", "static", "boolean", "isFileSizeUnderLimit", "(", "ByteSizeValue", "limit", ",", "long", "fileSizeAsBytes", ")", "{", "boolean", "result", "=", "true", ";", "if", "(", "limit", "!=", "null", ")", "{", "// We check the file size to avoid indexing too big file...
Compare if a file size is strictly under a given limit @param limit Limit. If null, we consider that there is no limit and we return true. @param fileSizeAsBytes File size @return true if under the limit. false otherwise.
[ "Compare", "if", "a", "file", "size", "is", "strictly", "under", "a", "given", "limit" ]
train
https://github.com/dadoonet/fscrawler/blob/cca00a14e21ef9986aa30e19b160463aed6bf921/framework/src/main/java/fr/pilato/elasticsearch/crawler/fs/framework/FsCrawlerUtil.java#L612-L624