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
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/MPP12Reader.java
MPP12Reader.processCustomValueLists
private void processCustomValueLists() throws IOException { """ This method extracts and collates the value list information for custom column value lists. """ DirectoryEntry taskDir = (DirectoryEntry) m_projectDir.getEntry("TBkndTask"); Props taskProps = new Props12(m_inputStreamFactory.getInstan...
java
private void processCustomValueLists() throws IOException { DirectoryEntry taskDir = (DirectoryEntry) m_projectDir.getEntry("TBkndTask"); Props taskProps = new Props12(m_inputStreamFactory.getInstance(taskDir, "Props")); CustomFieldValueReader12 reader = new CustomFieldValueReader12(m_file.getProj...
[ "private", "void", "processCustomValueLists", "(", ")", "throws", "IOException", "{", "DirectoryEntry", "taskDir", "=", "(", "DirectoryEntry", ")", "m_projectDir", ".", "getEntry", "(", "\"TBkndTask\"", ")", ";", "Props", "taskProps", "=", "new", "Props12", "(", ...
This method extracts and collates the value list information for custom column value lists.
[ "This", "method", "extracts", "and", "collates", "the", "value", "list", "information", "for", "custom", "column", "value", "lists", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPP12Reader.java#L199-L206
find-sec-bugs/find-sec-bugs
findsecbugs-plugin/src/main/java/com/h3xstream/findsecbugs/common/InterfaceUtils.java
InterfaceUtils.isSubtype
public static boolean isSubtype(String className, String... superClasses) { """ Test if the given class is a subtype of ONE of the super classes given. <br/> The following test that the class is a subclass of Hashtable. <pre> boolean isHashtable = InterfaceUtils.isSubtype( classThatCouldBeAHashTable, "java.uti...
java
public static boolean isSubtype(String className, String... superClasses) { for(String potentialSuperClass : superClasses) { try { if(Hierarchy.isSubtype(className, potentialSuperClass)) { return true; } } catch (ClassNotFoundException ...
[ "public", "static", "boolean", "isSubtype", "(", "String", "className", ",", "String", "...", "superClasses", ")", "{", "for", "(", "String", "potentialSuperClass", ":", "superClasses", ")", "{", "try", "{", "if", "(", "Hierarchy", ".", "isSubtype", "(", "cl...
Test if the given class is a subtype of ONE of the super classes given. <br/> The following test that the class is a subclass of Hashtable. <pre> boolean isHashtable = InterfaceUtils.isSubtype( classThatCouldBeAHashTable, "java.util.Hashtable"); </pre> @param className Class to test @param superClasses If classes exte...
[ "Test", "if", "the", "given", "class", "is", "a", "subtype", "of", "ONE", "of", "the", "super", "classes", "given", ".", "<br", "/", ">", "The", "following", "test", "that", "the", "class", "is", "a", "subclass", "of", "Hashtable", ".", "<pre", ">", ...
train
https://github.com/find-sec-bugs/find-sec-bugs/blob/362da013cef4925e6a1506dd3511fe5bdcc5fba3/findsecbugs-plugin/src/main/java/com/h3xstream/findsecbugs/common/InterfaceUtils.java#L54-L65
beangle/beangle3
struts/s2/src/main/java/org/beangle/struts2/view/component/UIBean.java
UIBean.processLabel
protected String processLabel(String label, String name) { """ Process label,convert empty to null @param label @param name @return """ if (null != label) { if (Strings.isEmpty(label)) return null; else return getText(label); } else return getText(name); }
java
protected String processLabel(String label, String name) { if (null != label) { if (Strings.isEmpty(label)) return null; else return getText(label); } else return getText(name); }
[ "protected", "String", "processLabel", "(", "String", "label", ",", "String", "name", ")", "{", "if", "(", "null", "!=", "label", ")", "{", "if", "(", "Strings", ".", "isEmpty", "(", "label", ")", ")", "return", "null", ";", "else", "return", "getText"...
Process label,convert empty to null @param label @param name @return
[ "Process", "label", "convert", "empty", "to", "null" ]
train
https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/struts/s2/src/main/java/org/beangle/struts2/view/component/UIBean.java#L191-L196
googleads/googleads-java-lib
examples/admanager_axis/src/main/java/admanager/axis/v201811/inventoryservice/CreateAdUnits.java
CreateAdUnits.runExample
public static void runExample(AdManagerServices adManagerServices, AdManagerSession session) throws RemoteException { """ Runs the example. @param adManagerServices the services factory. @param session the session. @throws ApiException if the API request failed with one or more service errors. @throws ...
java
public static void runExample(AdManagerServices adManagerServices, AdManagerSession session) throws RemoteException { // Get the InventoryService. InventoryServiceInterface inventoryService = adManagerServices.get(session, InventoryServiceInterface.class); // Get the NetworkService. Netwo...
[ "public", "static", "void", "runExample", "(", "AdManagerServices", "adManagerServices", ",", "AdManagerSession", "session", ")", "throws", "RemoteException", "{", "// Get the InventoryService.", "InventoryServiceInterface", "inventoryService", "=", "adManagerServices", ".", ...
Runs the example. @param adManagerServices the services factory. @param session the session. @throws ApiException if the API request failed with one or more service errors. @throws RemoteException if the API request failed due to other errors.
[ "Runs", "the", "example", "." ]
train
https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/admanager_axis/src/main/java/admanager/axis/v201811/inventoryservice/CreateAdUnits.java#L55-L112
javamelody/javamelody
javamelody-swing/src/main/java/net/bull/javamelody/swing/MDateDocument.java
MDateDocument.getDisplayDateFormat
public static SimpleDateFormat getDisplayDateFormat() { """ Retourne la valeur de la propriété displayDateFormat. @return SimpleDateFormat """ if (displayDateFormat == null) { // NOPMD String pattern = getDateFormat().toPattern(); // si le pattern contient seulement 2 chiffres pour l'année on en me...
java
public static SimpleDateFormat getDisplayDateFormat() { if (displayDateFormat == null) { // NOPMD String pattern = getDateFormat().toPattern(); // si le pattern contient seulement 2 chiffres pour l'année on en met 4 // parce que c'est plus clair à l'affichage // mais en saisie on peut toujours n'en m...
[ "public", "static", "SimpleDateFormat", "getDisplayDateFormat", "(", ")", "{", "if", "(", "displayDateFormat", "==", "null", ")", "{", "// NOPMD\r", "String", "pattern", "=", "getDateFormat", "(", ")", ".", "toPattern", "(", ")", ";", "// si le pattern contient se...
Retourne la valeur de la propriété displayDateFormat. @return SimpleDateFormat
[ "Retourne", "la", "valeur", "de", "la", "propriété", "displayDateFormat", "." ]
train
https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/MDateDocument.java#L141-L155
mangstadt/biweekly
src/main/java/biweekly/component/ICalComponent.java
ICalComponent.setProperty
public <T extends ICalProperty> List<T> setProperty(Class<T> clazz, T property) { """ Replaces all existing properties of the given class with a single property instance. If the property instance is null, then all instances of that property will be removed. @param clazz the property class (e.g. "DateStart.class...
java
public <T extends ICalProperty> List<T> setProperty(Class<T> clazz, T property) { List<ICalProperty> replaced = properties.replace(clazz, property); return castList(replaced, clazz); }
[ "public", "<", "T", "extends", "ICalProperty", ">", "List", "<", "T", ">", "setProperty", "(", "Class", "<", "T", ">", "clazz", ",", "T", "property", ")", "{", "List", "<", "ICalProperty", ">", "replaced", "=", "properties", ".", "replace", "(", "clazz...
Replaces all existing properties of the given class with a single property instance. If the property instance is null, then all instances of that property will be removed. @param clazz the property class (e.g. "DateStart.class") @param property the property or null to remove all properties of the given class @param <T>...
[ "Replaces", "all", "existing", "properties", "of", "the", "given", "class", "with", "a", "single", "property", "instance", ".", "If", "the", "property", "instance", "is", "null", "then", "all", "instances", "of", "that", "property", "will", "be", "removed", ...
train
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/ICalComponent.java#L132-L135
lightblueseas/vintage-time
src/main/java/de/alpharogroup/date/ParseDateExtensions.java
ParseDateExtensions.parseToDate
public static Date parseToDate(final String date, final String format) throws ParseException { """ Parses the String date to a date object. For example: USA-Format is : yyyy-MM-dd @param date The Date as String @param format The Format for the Date to parse @return The parsed Date @throws ParseException o...
java
public static Date parseToDate(final String date, final String format) throws ParseException { final DateFormat df = new SimpleDateFormat(format); Date parsedDate = null; parsedDate = df.parse(date); return parsedDate; }
[ "public", "static", "Date", "parseToDate", "(", "final", "String", "date", ",", "final", "String", "format", ")", "throws", "ParseException", "{", "final", "DateFormat", "df", "=", "new", "SimpleDateFormat", "(", "format", ")", ";", "Date", "parsedDate", "=", ...
Parses the String date to a date object. For example: USA-Format is : yyyy-MM-dd @param date The Date as String @param format The Format for the Date to parse @return The parsed Date @throws ParseException occurs when their are problems with parsing the String to Date.
[ "Parses", "the", "String", "date", "to", "a", "date", "object", ".", "For", "example", ":", "USA", "-", "Format", "is", ":", "yyyy", "-", "MM", "-", "dd" ]
train
https://github.com/lightblueseas/vintage-time/blob/fbf201e679d9f9b92e7b5771f3eea1413cc2e113/src/main/java/de/alpharogroup/date/ParseDateExtensions.java#L84-L90
bazaarvoice/ostrich
core/src/main/java/com/bazaarvoice/ostrich/PartitionContextBuilder.java
PartitionContextBuilder.put
public PartitionContextBuilder put(String key, Object value) { """ Adds the specified key and value to the partition context. Null keys or values and duplicate keys are not allowed. @return this """ _map.put(key, value); return this; }
java
public PartitionContextBuilder put(String key, Object value) { _map.put(key, value); return this; }
[ "public", "PartitionContextBuilder", "put", "(", "String", "key", ",", "Object", "value", ")", "{", "_map", ".", "put", "(", "key", ",", "value", ")", ";", "return", "this", ";", "}" ]
Adds the specified key and value to the partition context. Null keys or values and duplicate keys are not allowed. @return this
[ "Adds", "the", "specified", "key", "and", "value", "to", "the", "partition", "context", ".", "Null", "keys", "or", "values", "and", "duplicate", "keys", "are", "not", "allowed", "." ]
train
https://github.com/bazaarvoice/ostrich/blob/13591867870ab23445253f11fc872662a8028191/core/src/main/java/com/bazaarvoice/ostrich/PartitionContextBuilder.java#L41-L44
aws/aws-sdk-java
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/SendQueueBuffer.java
SendQueueBuffer.submitOutboundRequest
@SuppressWarnings("unchecked") <OBT extends OutboundBatchTask<R, Result>, R extends AmazonWebServiceRequest, Result> QueueBufferFuture<R, Result> submitOutboundRequest(Object operationLock, ...
java
@SuppressWarnings("unchecked") <OBT extends OutboundBatchTask<R, Result>, R extends AmazonWebServiceRequest, Result> QueueBufferFuture<R, Result> submitOutboundRequest(Object operationLock, ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "<", "OBT", "extends", "OutboundBatchTask", "<", "R", ",", "Result", ">", ",", "R", "extends", "AmazonWebServiceRequest", ",", "Result", ">", "QueueBufferFuture", "<", "R", ",", "Result", ">", "submitOutboundRe...
Submits an outbound request for delivery to the queue associated with this buffer. <p> @param operationLock the lock synchronizing calls for the call type ( {@code sendMessage}, {@code deleteMessage}, {@code changeMessageVisibility} ) @param openOutboundBatchTask the open batch task for this call type @param request t...
[ "Submits", "an", "outbound", "request", "for", "delivery", "to", "the", "queue", "associated", "with", "this", "buffer", ".", "<p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/SendQueueBuffer.java#L240-L294
intellimate/Izou
src/main/java/org/intellimate/izou/output/OutputManager.java
OutputManager.addOutputExtension
public void addOutputExtension(OutputExtensionModel<?, ?> outputExtension) throws IllegalIDException { """ adds output extension to desired outputPlugin <p> adds output extension to desired outputPlugin, so that the output-plugin can start and stop the outputExtension task as needed. The outputExtension is spec...
java
public void addOutputExtension(OutputExtensionModel<?, ?> outputExtension) throws IllegalIDException { if (outputExtensions.containsKey(outputExtension.getPluginId())) { outputExtensions.get(outputExtension.getPluginId()).add(outputExtension); } else { IdentifiableSet<OutputExten...
[ "public", "void", "addOutputExtension", "(", "OutputExtensionModel", "<", "?", ",", "?", ">", "outputExtension", ")", "throws", "IllegalIDException", "{", "if", "(", "outputExtensions", ".", "containsKey", "(", "outputExtension", ".", "getPluginId", "(", ")", ")",...
adds output extension to desired outputPlugin <p> adds output extension to desired outputPlugin, so that the output-plugin can start and stop the outputExtension task as needed. The outputExtension is specific to the output-plugin @param outputExtension the outputExtension to be added @throws IllegalIDException not ye...
[ "adds", "output", "extension", "to", "desired", "outputPlugin", "<p", ">", "adds", "output", "extension", "to", "desired", "outputPlugin", "so", "that", "the", "output", "-", "plugin", "can", "start", "and", "stop", "the", "outputExtension", "task", "as", "nee...
train
https://github.com/intellimate/Izou/blob/40a808b97998e17655c4a78e30ce7326148aed27/src/main/java/org/intellimate/izou/output/OutputManager.java#L101-L113
jpaoletti/java-presentation-manager
modules/jpm-core/src/main/java/jpaoletti/jpm/core/PMContext.java
PMContext.getParameter
public Object getParameter(String paramid, Object def) { """ Look for a parameter in the context with the given name. If parmeter is null, return def @param paramid parameter id @param def default value @return parameter value or def if null """ final Object v = getParameter(paramid); if ...
java
public Object getParameter(String paramid, Object def) { final Object v = getParameter(paramid); if (v == null) { return def; } else { return v; } }
[ "public", "Object", "getParameter", "(", "String", "paramid", ",", "Object", "def", ")", "{", "final", "Object", "v", "=", "getParameter", "(", "paramid", ")", ";", "if", "(", "v", "==", "null", ")", "{", "return", "def", ";", "}", "else", "{", "retu...
Look for a parameter in the context with the given name. If parmeter is null, return def @param paramid parameter id @param def default value @return parameter value or def if null
[ "Look", "for", "a", "parameter", "in", "the", "context", "with", "the", "given", "name", ".", "If", "parmeter", "is", "null", "return", "def" ]
train
https://github.com/jpaoletti/java-presentation-manager/blob/d5aab55638383695db244744b4bfe27c5200e04f/modules/jpm-core/src/main/java/jpaoletti/jpm/core/PMContext.java#L276-L283
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java
ExceptionUtils.getStackFrameList
@GwtIncompatible("incompatible method") static List<String> getStackFrameList(final Throwable t) { """ <p>Produces a <code>List</code> of stack frames - the message is not included. Only the trace of the specified exception is returned, any caused by trace is stripped.</p> <p>This works in most cases - it...
java
@GwtIncompatible("incompatible method") static List<String> getStackFrameList(final Throwable t) { final String stackTrace = getStackTrace(t); final String linebreak = System.lineSeparator(); final StringTokenizer frames = new StringTokenizer(stackTrace, linebreak); final List<String...
[ "@", "GwtIncompatible", "(", "\"incompatible method\"", ")", "static", "List", "<", "String", ">", "getStackFrameList", "(", "final", "Throwable", "t", ")", "{", "final", "String", "stackTrace", "=", "getStackTrace", "(", "t", ")", ";", "final", "String", "lin...
<p>Produces a <code>List</code> of stack frames - the message is not included. Only the trace of the specified exception is returned, any caused by trace is stripped.</p> <p>This works in most cases - it will only fail if the exception message contains a line that starts with: <code>&quot;&nbsp;&nbsp;&nbsp;at&quot;.</...
[ "<p", ">", "Produces", "a", "<code", ">", "List<", "/", "code", ">", "of", "stack", "frames", "-", "the", "message", "is", "not", "included", ".", "Only", "the", "trace", "of", "the", "specified", "exception", "is", "returned", "any", "caused", "by", "...
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java#L656-L675
googleapis/cloud-bigtable-client
bigtable-client-core-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/adapters/read/RowRangeAdapter.java
RowRangeAdapter.rangeSetToByteStringRange
@VisibleForTesting void rangeSetToByteStringRange(RangeSet<RowKeyWrapper> guavaRangeSet, Query query) { """ Convert guava's {@link RangeSet} to Bigtable's {@link ByteStringRange}. Please note that this will convert boundless ranges into unset key cases. """ for (Range<RowKeyWrapper> guavaRange : guavaR...
java
@VisibleForTesting void rangeSetToByteStringRange(RangeSet<RowKeyWrapper> guavaRangeSet, Query query) { for (Range<RowKeyWrapper> guavaRange : guavaRangeSet.asRanges()) { // Is it a point? if (guavaRange.hasLowerBound() && guavaRange.lowerBoundType() == BoundType.CLOSED && guavaRange.hasUpp...
[ "@", "VisibleForTesting", "void", "rangeSetToByteStringRange", "(", "RangeSet", "<", "RowKeyWrapper", ">", "guavaRangeSet", ",", "Query", "query", ")", "{", "for", "(", "Range", "<", "RowKeyWrapper", ">", "guavaRange", ":", "guavaRangeSet", ".", "asRanges", "(", ...
Convert guava's {@link RangeSet} to Bigtable's {@link ByteStringRange}. Please note that this will convert boundless ranges into unset key cases.
[ "Convert", "guava", "s", "{" ]
train
https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/adapters/read/RowRangeAdapter.java#L131-L176
OpenLiberty/open-liberty
dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/spi/DistributedMapFactory.java
DistributedMapFactory.getMap
@Deprecated public static DistributedMap getMap(String name, Properties properties) { """ Returns the DistributedMap instance specified by the given id, using the the parameters specified in properties. If the given instance has not yet been created, then a new instance is created using the parameters speci...
java
@Deprecated public static DistributedMap getMap(String name, Properties properties) { return DistributedObjectCacheFactory.getMap(name, properties); }
[ "@", "Deprecated", "public", "static", "DistributedMap", "getMap", "(", "String", "name", ",", "Properties", "properties", ")", "{", "return", "DistributedObjectCacheFactory", ".", "getMap", "(", "name", ",", "properties", ")", ";", "}" ]
Returns the DistributedMap instance specified by the given id, using the the parameters specified in properties. If the given instance has not yet been created, then a new instance is created using the parameters specified in the properties object. <br>Properties: <table role="presentation"> <tr><td>com.ibm.ws.cache.Ca...
[ "Returns", "the", "DistributedMap", "instance", "specified", "by", "the", "given", "id", "using", "the", "the", "parameters", "specified", "in", "properties", ".", "If", "the", "given", "instance", "has", "not", "yet", "been", "created", "then", "a", "new", ...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/spi/DistributedMapFactory.java#L64-L67
albfernandez/itext2
src/main/java/com/lowagie/text/pdf/PdfCopy.java
PdfCopy.copyStream
protected PdfStream copyStream(PRStream in) throws IOException, BadPdfFormatException { """ Translate a PRStream to a PdfStream. The data part copies itself. """ PRStream out = new PRStream(in, null); for (Iterator it = in.getKeys().iterator(); it.hasNext();) { PdfName key ...
java
protected PdfStream copyStream(PRStream in) throws IOException, BadPdfFormatException { PRStream out = new PRStream(in, null); for (Iterator it = in.getKeys().iterator(); it.hasNext();) { PdfName key = (PdfName) it.next(); PdfObject value = in.get(key); out.p...
[ "protected", "PdfStream", "copyStream", "(", "PRStream", "in", ")", "throws", "IOException", ",", "BadPdfFormatException", "{", "PRStream", "out", "=", "new", "PRStream", "(", "in", ",", "null", ")", ";", "for", "(", "Iterator", "it", "=", "in", ".", "getK...
Translate a PRStream to a PdfStream. The data part copies itself.
[ "Translate", "a", "PRStream", "to", "a", "PdfStream", ".", "The", "data", "part", "copies", "itself", "." ]
train
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfCopy.java#L243-L253
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DestinationManager.java
DestinationManager.getDestination
public DestinationHandler getDestination(JsDestinationAddress destinationAddr, boolean includeInvisible) throws SITemporaryDestinationNotFoundException, SIResourceException, SINotPossibleInCurrentConfigurationException { """ This method provides lookup of a destination by its address. If the ...
java
public DestinationHandler getDestination(JsDestinationAddress destinationAddr, boolean includeInvisible) throws SITemporaryDestinationNotFoundException, SIResourceException, SINotPossibleInCurrentConfigurationException { return getDestination(destinationAddr.getDestinationName(), ...
[ "public", "DestinationHandler", "getDestination", "(", "JsDestinationAddress", "destinationAddr", ",", "boolean", "includeInvisible", ")", "throws", "SITemporaryDestinationNotFoundException", ",", "SIResourceException", ",", "SINotPossibleInCurrentConfigurationException", "{", "ret...
This method provides lookup of a destination by its address. If the destination is not found, it throws SIDestinationNotFoundException. @param destinationAddr @return Destination @throws SIDestinationNotFoundException @throws SIMPNullParameterException @throws SIMPDestinationCorruptException
[ "This", "method", "provides", "lookup", "of", "a", "destination", "by", "its", "address", ".", "If", "the", "destination", "is", "not", "found", "it", "throws", "SIDestinationNotFoundException", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DestinationManager.java#L1116-L1124
Jasig/uPortal
uPortal-tenants/src/main/java/org/apereo/portal/tenants/TenantService.java
TenantService.validateAttribute
public void validateAttribute(final String key, final String value) throws Exception { """ Throws an exception if any {@linkITenantOperationsListener} indicates that the specified value isn't allowable for the specified attribute. @throws Exception @since 4.3 """ for (ITenantOperationsListener lis...
java
public void validateAttribute(final String key, final String value) throws Exception { for (ITenantOperationsListener listener : tenantOperationsListeners) { // Will throw an exception if not valid listener.validateAttribute(key, value); } }
[ "public", "void", "validateAttribute", "(", "final", "String", "key", ",", "final", "String", "value", ")", "throws", "Exception", "{", "for", "(", "ITenantOperationsListener", "listener", ":", "tenantOperationsListeners", ")", "{", "// Will throw an exception if not va...
Throws an exception if any {@linkITenantOperationsListener} indicates that the specified value isn't allowable for the specified attribute. @throws Exception @since 4.3
[ "Throws", "an", "exception", "if", "any", "{", "@linkITenantOperationsListener", "}", "indicates", "that", "the", "specified", "value", "isn", "t", "allowable", "for", "the", "specified", "attribute", "." ]
train
https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-tenants/src/main/java/org/apereo/portal/tenants/TenantService.java#L374-L379
jtmelton/appsensor
appsensor-core/src/main/java/org/owasp/appsensor/core/storage/EventStore.java
EventStore.isMatchingEvent
protected boolean isMatchingEvent(SearchCriteria criteria, Event event) { """ A finder for Event objects in the EventStore @param criteria the {@link org.owasp.appsensor.core.criteria.SearchCriteria} object to search by @param event the {@link Event} object to match on @return true or false depending on the m...
java
protected boolean isMatchingEvent(SearchCriteria criteria, Event event) { boolean match = false; User user = criteria.getUser(); DetectionPoint detectionPoint = criteria.getDetectionPoint(); Rule rule = criteria.getRule(); Collection<String> detectionSystemIds = criteria.getDetectionSystemIds(); DateTime e...
[ "protected", "boolean", "isMatchingEvent", "(", "SearchCriteria", "criteria", ",", "Event", "event", ")", "{", "boolean", "match", "=", "false", ";", "User", "user", "=", "criteria", ".", "getUser", "(", ")", ";", "DetectionPoint", "detectionPoint", "=", "crit...
A finder for Event objects in the EventStore @param criteria the {@link org.owasp.appsensor.core.criteria.SearchCriteria} object to search by @param event the {@link Event} object to match on @return true or false depending on the matching of the search criteria to the event
[ "A", "finder", "for", "Event", "objects", "in", "the", "EventStore" ]
train
https://github.com/jtmelton/appsensor/blob/c3b4e9ada50fdee974e0d618ec4bdfabc2163798/appsensor-core/src/main/java/org/owasp/appsensor/core/storage/EventStore.java#L126-L161
apache/incubator-gobblin
gobblin-service/src/main/java/org/apache/gobblin/service/modules/core/GitFlowGraphMonitor.java
GitFlowGraphMonitor.addDataNode
private void addDataNode(DiffEntry change) { """ Add a {@link DataNode} to the {@link FlowGraph}. The method uses the {@link FlowGraphConfigurationKeys#DATA_NODE_CLASS} config to instantiate a {@link DataNode} from the node config file. @param change """ if (checkFilePath(change.getNewPath(), NODE_FILE_D...
java
private void addDataNode(DiffEntry change) { if (checkFilePath(change.getNewPath(), NODE_FILE_DEPTH)) { Path nodeFilePath = new Path(this.repositoryDir, change.getNewPath()); try { Config config = loadNodeFileWithOverrides(nodeFilePath); Class dataNodeClass = Class.forName(ConfigUtils.ge...
[ "private", "void", "addDataNode", "(", "DiffEntry", "change", ")", "{", "if", "(", "checkFilePath", "(", "change", ".", "getNewPath", "(", ")", ",", "NODE_FILE_DEPTH", ")", ")", "{", "Path", "nodeFilePath", "=", "new", "Path", "(", "this", ".", "repository...
Add a {@link DataNode} to the {@link FlowGraph}. The method uses the {@link FlowGraphConfigurationKeys#DATA_NODE_CLASS} config to instantiate a {@link DataNode} from the node config file. @param change
[ "Add", "a", "{" ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-service/src/main/java/org/apache/gobblin/service/modules/core/GitFlowGraphMonitor.java#L176-L193
NordicSemiconductor/Android-DFU-Library
dfu/src/main/java/no/nordicsemi/android/dfu/DfuServiceInitiator.java
DfuServiceInitiator.setBinOrHex
@Deprecated public DfuServiceInitiator setBinOrHex(@FileType final int fileType, @NonNull final Uri uri) { """ Sets the URI of the BIN or HEX file containing the new firmware. For DFU Bootloader version 0.5 or newer the init file must be specified using one of {@link #setInitFile(Uri)} methods. @param fileTy...
java
@Deprecated public DfuServiceInitiator setBinOrHex(@FileType final int fileType, @NonNull final Uri uri) { if (fileType == DfuBaseService.TYPE_AUTO) throw new UnsupportedOperationException("You must specify the file type"); return init(uri, null, 0, fileType, DfuBaseService.MIME_TYPE_OCTET_STREAM); }
[ "@", "Deprecated", "public", "DfuServiceInitiator", "setBinOrHex", "(", "@", "FileType", "final", "int", "fileType", ",", "@", "NonNull", "final", "Uri", "uri", ")", "{", "if", "(", "fileType", "==", "DfuBaseService", ".", "TYPE_AUTO", ")", "throw", "new", "...
Sets the URI of the BIN or HEX file containing the new firmware. For DFU Bootloader version 0.5 or newer the init file must be specified using one of {@link #setInitFile(Uri)} methods. @param fileType the file type, a bit field created from: <ul> <li>{@link DfuBaseService#TYPE_APPLICATION} - the Application will be se...
[ "Sets", "the", "URI", "of", "the", "BIN", "or", "HEX", "file", "containing", "the", "new", "firmware", ".", "For", "DFU", "Bootloader", "version", "0", ".", "5", "or", "newer", "the", "init", "file", "must", "be", "specified", "using", "one", "of", "{"...
train
https://github.com/NordicSemiconductor/Android-DFU-Library/blob/ec14c8c522bebe801a9a4c3dfbbeb1f53262c03f/dfu/src/main/java/no/nordicsemi/android/dfu/DfuServiceInitiator.java#L622-L627
nguillaumin/slick2d-maven
slick2d-peditor/src/main/java/org/newdawn/slick/tools/peditor/GradientEditor.java
GradientEditor.checkPoint
private boolean checkPoint(int mx, int my, ControlPoint pt) { """ Check if there is a control point at the specified mouse location @param mx The mouse x coordinate @param my The mouse y coordinate @param pt The point to check agianst @return True if the mouse point conincides with the control point """ ...
java
private boolean checkPoint(int mx, int my, ControlPoint pt) { int dx = (int) Math.abs((10+(width * pt.pos)) - mx); int dy = Math.abs((y+barHeight+7)-my); if ((dx < 5) && (dy < 7)) { return true; } return false; }
[ "private", "boolean", "checkPoint", "(", "int", "mx", ",", "int", "my", ",", "ControlPoint", "pt", ")", "{", "int", "dx", "=", "(", "int", ")", "Math", ".", "abs", "(", "(", "10", "+", "(", "width", "*", "pt", ".", "pos", ")", ")", "-", "mx", ...
Check if there is a control point at the specified mouse location @param mx The mouse x coordinate @param my The mouse y coordinate @param pt The point to check agianst @return True if the mouse point conincides with the control point
[ "Check", "if", "there", "is", "a", "control", "point", "at", "the", "specified", "mouse", "location" ]
train
https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-peditor/src/main/java/org/newdawn/slick/tools/peditor/GradientEditor.java#L164-L173
actorapp/actor-platform
actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageLoading.java
ImageLoading.loadBitmapOptimized
public static Bitmap loadBitmapOptimized(Uri uri, Context context) throws ImageLoadException { """ Loading bitmap with optimized loaded size less than 1.4 MPX @param uri content uri for bitmap @param context Application Context @return loaded bitmap (always not null) @throws ImageLoadException if it is u...
java
public static Bitmap loadBitmapOptimized(Uri uri, Context context) throws ImageLoadException { return loadBitmapOptimized(uri, context, MAX_PIXELS); }
[ "public", "static", "Bitmap", "loadBitmapOptimized", "(", "Uri", "uri", ",", "Context", "context", ")", "throws", "ImageLoadException", "{", "return", "loadBitmapOptimized", "(", "uri", ",", "context", ",", "MAX_PIXELS", ")", ";", "}" ]
Loading bitmap with optimized loaded size less than 1.4 MPX @param uri content uri for bitmap @param context Application Context @return loaded bitmap (always not null) @throws ImageLoadException if it is unable to load file
[ "Loading", "bitmap", "with", "optimized", "loaded", "size", "less", "than", "1", ".", "4", "MPX" ]
train
https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageLoading.java#L97-L99
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/flow/HornSchunck.java
HornSchunck.innerAverageFlow
protected static void innerAverageFlow( ImageFlow flow , ImageFlow averageFlow ) { """ Computes average flow using an 8-connect neighborhood for the inner image """ int endX = flow.width-1; int endY = flow.height-1; for( int y = 1; y < endY; y++ ) { int index = flow.width*y + 1; for( int x = 1; x...
java
protected static void innerAverageFlow( ImageFlow flow , ImageFlow averageFlow ) { int endX = flow.width-1; int endY = flow.height-1; for( int y = 1; y < endY; y++ ) { int index = flow.width*y + 1; for( int x = 1; x < endX; x++ , index++) { ImageFlow.D average = averageFlow.data[index]; ImageFlow...
[ "protected", "static", "void", "innerAverageFlow", "(", "ImageFlow", "flow", ",", "ImageFlow", "averageFlow", ")", "{", "int", "endX", "=", "flow", ".", "width", "-", "1", ";", "int", "endY", "=", "flow", ".", "height", "-", "1", ";", "for", "(", "int"...
Computes average flow using an 8-connect neighborhood for the inner image
[ "Computes", "average", "flow", "using", "an", "8", "-", "connect", "neighborhood", "for", "the", "inner", "image" ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/flow/HornSchunck.java#L125-L149
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/quantiles/DoublesSketch.java
DoublesSketch.getCompactStorageBytes
public static int getCompactStorageBytes(final int k, final long n) { """ Returns the number of bytes a DoublesSketch would require to store in compact form given the values of <i>k</i> and <i>n</i>. The compact form is not updatable. @param k the size configuration parameter for the sketch @param n the number ...
java
public static int getCompactStorageBytes(final int k, final long n) { if (n == 0) { return 8; } final int metaPreLongs = DoublesSketch.MAX_PRELONGS + 2; //plus min, max return ((metaPreLongs + Util.computeRetainedItems(k, n)) << 3); }
[ "public", "static", "int", "getCompactStorageBytes", "(", "final", "int", "k", ",", "final", "long", "n", ")", "{", "if", "(", "n", "==", "0", ")", "{", "return", "8", ";", "}", "final", "int", "metaPreLongs", "=", "DoublesSketch", ".", "MAX_PRELONGS", ...
Returns the number of bytes a DoublesSketch would require to store in compact form given the values of <i>k</i> and <i>n</i>. The compact form is not updatable. @param k the size configuration parameter for the sketch @param n the number of items input into the sketch @return the number of bytes required to store this ...
[ "Returns", "the", "number", "of", "bytes", "a", "DoublesSketch", "would", "require", "to", "store", "in", "compact", "form", "given", "the", "values", "of", "<i", ">", "k<", "/", "i", ">", "and", "<i", ">", "n<", "/", "i", ">", ".", "The", "compact",...
train
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/quantiles/DoublesSketch.java#L630-L634
sd4324530/fastweixin
src/main/java/com/github/sd4324530/fastweixin/util/JSONUtil.java
JSONUtil.toBean
public static <T> T toBean(String jsonStr, Class<T> beanClass) { """ 将json字符串,转换成指定java bean @param jsonStr json串对象 @param beanClass 指定的bean @param <T> 任意bean的类型 @return 转换后的java bean对象 """ requireNonNull(jsonStr, "jsonStr is null"); JSONObject jo = JSON.parseObject(jsonStr); ...
java
public static <T> T toBean(String jsonStr, Class<T> beanClass) { requireNonNull(jsonStr, "jsonStr is null"); JSONObject jo = JSON.parseObject(jsonStr); jo.put(JSON.DEFAULT_TYPE_KEY, beanClass.getName()); return JSON.parseObject(jo.toJSONString(), beanClass); }
[ "public", "static", "<", "T", ">", "T", "toBean", "(", "String", "jsonStr", ",", "Class", "<", "T", ">", "beanClass", ")", "{", "requireNonNull", "(", "jsonStr", ",", "\"jsonStr is null\"", ")", ";", "JSONObject", "jo", "=", "JSON", ".", "parseObject", "...
将json字符串,转换成指定java bean @param jsonStr json串对象 @param beanClass 指定的bean @param <T> 任意bean的类型 @return 转换后的java bean对象
[ "将json字符串,转换成指定java", "bean" ]
train
https://github.com/sd4324530/fastweixin/blob/6bc0a7abfa23aad0dbad4c3123a47a7fb53f3447/src/main/java/com/github/sd4324530/fastweixin/util/JSONUtil.java#L62-L67
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/abst/feature/tracker/PointTrackerKltPyramid.java
PointTrackerKltPyramid.addTrack
public PointTrack addTrack( double x , double y ) { """ Creates a new feature track at the specified location. Must only be called after {@link #process(ImageGray)} has been called. It can fail if there is insufficient texture @param x x-coordinate @param y y-coordinate @return the new track if successful ...
java
public PointTrack addTrack( double x , double y ) { if( !input.isInBounds((int)x,(int)y)) return null; // grow the number of tracks if needed if( unused.isEmpty() ) addTrackToUnused(); // TODO make sure the feature is inside the image PyramidKltFeature t = unused.remove(unused.size() - 1); t.setPos...
[ "public", "PointTrack", "addTrack", "(", "double", "x", ",", "double", "y", ")", "{", "if", "(", "!", "input", ".", "isInBounds", "(", "(", "int", ")", "x", ",", "(", "int", ")", "y", ")", ")", "return", "null", ";", "// grow the number of tracks if ne...
Creates a new feature track at the specified location. Must only be called after {@link #process(ImageGray)} has been called. It can fail if there is insufficient texture @param x x-coordinate @param y y-coordinate @return the new track if successful or null if no new track could be created
[ "Creates", "a", "new", "feature", "track", "at", "the", "specified", "location", ".", "Must", "only", "be", "called", "after", "{", "@link", "#process", "(", "ImageGray", ")", "}", "has", "been", "called", ".", "It", "can", "fail", "if", "there", "is", ...
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/feature/tracker/PointTrackerKltPyramid.java#L139-L162
eclipse/xtext-extras
org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/scoping/batch/FeatureScopes.java
FeatureScopes.createNestedTypeLiteralScope
protected IScope createNestedTypeLiteralScope( EObject featureCall, LightweightTypeReference enclosingType, JvmDeclaredType rawEnclosingType, IScope parent, IFeatureScopeSession session) { """ Create a scope that returns nested types. @param featureCall the feature call that is currently processe...
java
protected IScope createNestedTypeLiteralScope( EObject featureCall, LightweightTypeReference enclosingType, JvmDeclaredType rawEnclosingType, IScope parent, IFeatureScopeSession session) { return new NestedTypeLiteralScope(parent, session, asAbstractFeatureCall(featureCall), enclosingType, rawEnclosing...
[ "protected", "IScope", "createNestedTypeLiteralScope", "(", "EObject", "featureCall", ",", "LightweightTypeReference", "enclosingType", ",", "JvmDeclaredType", "rawEnclosingType", ",", "IScope", "parent", ",", "IFeatureScopeSession", "session", ")", "{", "return", "new", ...
Create a scope that returns nested types. @param featureCall the feature call that is currently processed by the scoping infrastructure @param enclosingType the enclosing type including type parameters for the nested type literal scope. @param rawEnclosingType the raw type that is used to query the nested types. @para...
[ "Create", "a", "scope", "that", "returns", "nested", "types", "." ]
train
https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/scoping/batch/FeatureScopes.java#L600-L607
ngageoint/geopackage-core-java
src/main/java/mil/nga/geopackage/user/UserTable.java
UserTable.typeCheck
protected void typeCheck(GeoPackageDataType expected, TColumn column) { """ Check for the expected data type @param expected expected data type @param column user column """ GeoPackageDataType actual = column.getDataType(); if (actual == null || !actual.equals(expected)) { throw new GeoPackageExc...
java
protected void typeCheck(GeoPackageDataType expected, TColumn column) { GeoPackageDataType actual = column.getDataType(); if (actual == null || !actual.equals(expected)) { throw new GeoPackageException("Unexpected " + column.getName() + " column data type was found for table '" + tableName + "', expec...
[ "protected", "void", "typeCheck", "(", "GeoPackageDataType", "expected", ",", "TColumn", "column", ")", "{", "GeoPackageDataType", "actual", "=", "column", ".", "getDataType", "(", ")", ";", "if", "(", "actual", "==", "null", "||", "!", "actual", ".", "equal...
Check for the expected data type @param expected expected data type @param column user column
[ "Check", "for", "the", "expected", "data", "type" ]
train
https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/user/UserTable.java#L175-L184
prestodb/presto
presto-main/src/main/java/com/facebook/presto/metadata/FunctionManager.java
FunctionManager.lookupFunction
public FunctionHandle lookupFunction(String name, List<TypeSignatureProvider> parameterTypes) { """ Lookup up a function with name and fully bound types. This can only be used for builtin functions. {@link #resolveFunction(Session, QualifiedName, List)} should be used for dynamically registered functions. @thr...
java
public FunctionHandle lookupFunction(String name, List<TypeSignatureProvider> parameterTypes) { return staticFunctionNamespace.lookupFunction(QualifiedName.of(name), parameterTypes); }
[ "public", "FunctionHandle", "lookupFunction", "(", "String", "name", ",", "List", "<", "TypeSignatureProvider", ">", "parameterTypes", ")", "{", "return", "staticFunctionNamespace", ".", "lookupFunction", "(", "QualifiedName", ".", "of", "(", "name", ")", ",", "pa...
Lookup up a function with name and fully bound types. This can only be used for builtin functions. {@link #resolveFunction(Session, QualifiedName, List)} should be used for dynamically registered functions. @throws PrestoException if function could not be found
[ "Lookup", "up", "a", "function", "with", "name", "and", "fully", "bound", "types", ".", "This", "can", "only", "be", "used", "for", "builtin", "functions", ".", "{", "@link", "#resolveFunction", "(", "Session", "QualifiedName", "List", ")", "}", "should", ...
train
https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-main/src/main/java/com/facebook/presto/metadata/FunctionManager.java#L119-L122
robocup-atan/atan
src/main/java/com/github/robocup_atan/atan/model/XPMImage.java
XPMImage.getTile
public String getTile(int x, int y) { """ Gets a tile of the XPM Image. @param x Between 0 and 31. @param y Between 0 and 7. @return An XPM image string defining an 8*8 image. """ if ((x > getArrayWidth()) || (y > getArrayHeight()) || (x < 0) || (y < 0)) { throw new IllegalArgumentExce...
java
public String getTile(int x, int y) { if ((x > getArrayWidth()) || (y > getArrayHeight()) || (x < 0) || (y < 0)) { throw new IllegalArgumentException(); } return image[x][y]; }
[ "public", "String", "getTile", "(", "int", "x", ",", "int", "y", ")", "{", "if", "(", "(", "x", ">", "getArrayWidth", "(", ")", ")", "||", "(", "y", ">", "getArrayHeight", "(", ")", ")", "||", "(", "x", "<", "0", ")", "||", "(", "y", "<", "...
Gets a tile of the XPM Image. @param x Between 0 and 31. @param y Between 0 and 7. @return An XPM image string defining an 8*8 image.
[ "Gets", "a", "tile", "of", "the", "XPM", "Image", "." ]
train
https://github.com/robocup-atan/atan/blob/52237b468b09ba5b7c52d290984dbe0326c96df7/src/main/java/com/github/robocup_atan/atan/model/XPMImage.java#L86-L91
code4everything/util
src/main/java/com/zhazhapan/util/Checker.java
Checker.checkNull
public static Double checkNull(Double value, Double elseValue) { """ 检查Double是否为null @param value 值 @param elseValue 为null返回的值 @return {@link Double} @since 1.0.8 """ return isNull(value) ? elseValue : value; }
java
public static Double checkNull(Double value, Double elseValue) { return isNull(value) ? elseValue : value; }
[ "public", "static", "Double", "checkNull", "(", "Double", "value", ",", "Double", "elseValue", ")", "{", "return", "isNull", "(", "value", ")", "?", "elseValue", ":", "value", ";", "}" ]
检查Double是否为null @param value 值 @param elseValue 为null返回的值 @return {@link Double} @since 1.0.8
[ "检查Double是否为null" ]
train
https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/Checker.java#L1171-L1173
geomajas/geomajas-project-client-gwt2
common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java
StyleUtil.createFill
public static FillInfo createFill(String color, float opacity) { """ Creates a fill with the specified CSS parameters. @param color the color @param opacity the opacity @return the fill """ FillInfo fillInfo = new FillInfo(); if (color != null) { fillInfo.getCssParameterList().add(createCssParamete...
java
public static FillInfo createFill(String color, float opacity) { FillInfo fillInfo = new FillInfo(); if (color != null) { fillInfo.getCssParameterList().add(createCssParameter("fill", color)); } fillInfo.getCssParameterList().add(createCssParameter("fill-opacity", opacity)); return fillInfo; }
[ "public", "static", "FillInfo", "createFill", "(", "String", "color", ",", "float", "opacity", ")", "{", "FillInfo", "fillInfo", "=", "new", "FillInfo", "(", ")", ";", "if", "(", "color", "!=", "null", ")", "{", "fillInfo", ".", "getCssParameterList", "(",...
Creates a fill with the specified CSS parameters. @param color the color @param opacity the opacity @return the fill
[ "Creates", "a", "fill", "with", "the", "specified", "CSS", "parameters", "." ]
train
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java#L227-L234
SonarSource/sonarqube
server/sonar-server/src/main/java/org/sonar/server/component/ComponentUpdater.java
ComponentUpdater.createWithoutCommit
public ComponentDto createWithoutCommit(DbSession dbSession, NewComponent newComponent, @Nullable Integer userId) { """ Create component without committing. Don't forget to call commitAndIndex(...) when ready to commit. """ checkKeyFormat(newComponent.qualifier(), newComponent.key()); ComponentDto com...
java
public ComponentDto createWithoutCommit(DbSession dbSession, NewComponent newComponent, @Nullable Integer userId) { checkKeyFormat(newComponent.qualifier(), newComponent.key()); ComponentDto componentDto = createRootComponent(dbSession, newComponent); if (isRootProject(componentDto)) { createMainBranc...
[ "public", "ComponentDto", "createWithoutCommit", "(", "DbSession", "dbSession", ",", "NewComponent", "newComponent", ",", "@", "Nullable", "Integer", "userId", ")", "{", "checkKeyFormat", "(", "newComponent", ".", "qualifier", "(", ")", ",", "newComponent", ".", "...
Create component without committing. Don't forget to call commitAndIndex(...) when ready to commit.
[ "Create", "component", "without", "committing", ".", "Don", "t", "forget", "to", "call", "commitAndIndex", "(", "...", ")", "when", "ready", "to", "commit", "." ]
train
https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-server/src/main/java/org/sonar/server/component/ComponentUpdater.java#L87-L96
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/HSMDependenceMeasure.java
HSMDependenceMeasure.countAboveThreshold
private int countAboveThreshold(int[][] mat, double threshold) { """ Count the number of cells above the threshold. @param mat Matrix @param threshold Threshold @return Number of elements above the threshold. """ int ret = 0; for(int i = 0; i < mat.length; i++) { int[] row = mat[i]; fo...
java
private int countAboveThreshold(int[][] mat, double threshold) { int ret = 0; for(int i = 0; i < mat.length; i++) { int[] row = mat[i]; for(int j = 0; j < row.length; j++) { if(row[j] >= threshold) { ret++; } } } return ret; }
[ "private", "int", "countAboveThreshold", "(", "int", "[", "]", "[", "]", "mat", ",", "double", "threshold", ")", "{", "int", "ret", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "mat", ".", "length", ";", "i", "++", ")", "{", ...
Count the number of cells above the threshold. @param mat Matrix @param threshold Threshold @return Number of elements above the threshold.
[ "Count", "the", "number", "of", "cells", "above", "the", "threshold", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/HSMDependenceMeasure.java#L147-L158
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/util/AbstractLog.java
AbstractLog.mandatoryWarning
public void mandatoryWarning(LintCategory lc, DiagnosticPosition pos, Warning warningKey) { """ Report a warning. @param lc The lint category for the diagnostic @param pos The source position at which to report the warning. @param warningKey The key for the localized warning message. """ r...
java
public void mandatoryWarning(LintCategory lc, DiagnosticPosition pos, Warning warningKey) { report(diags.mandatoryWarning(lc, source, pos, warningKey)); }
[ "public", "void", "mandatoryWarning", "(", "LintCategory", "lc", ",", "DiagnosticPosition", "pos", ",", "Warning", "warningKey", ")", "{", "report", "(", "diags", ".", "mandatoryWarning", "(", "lc", ",", "source", ",", "pos", ",", "warningKey", ")", ")", ";"...
Report a warning. @param lc The lint category for the diagnostic @param pos The source position at which to report the warning. @param warningKey The key for the localized warning message.
[ "Report", "a", "warning", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/util/AbstractLog.java#L317-L319
strator-dev/greenpepper-open
extensions-external/fit/src/main/java/com/greenpepper/extensions/fit/Fit.java
Fit.isAFitInterpreter
public static boolean isAFitInterpreter(SystemUnderDevelopment sud, String name) { """ <p>isAFitInterpreter.</p> @param sud a {@link com.greenpepper.systemunderdevelopment.SystemUnderDevelopment} object. @param name a {@link java.lang.String} object. @return a boolean. """ try { O...
java
public static boolean isAFitInterpreter(SystemUnderDevelopment sud, String name) { try { Object target = sud.getFixture(name).getTarget(); if (target instanceof fit.Fixture && !target.getClass().equals(ActionFixture.class)) return true; } catch (Throwab...
[ "public", "static", "boolean", "isAFitInterpreter", "(", "SystemUnderDevelopment", "sud", ",", "String", "name", ")", "{", "try", "{", "Object", "target", "=", "sud", ".", "getFixture", "(", "name", ")", ".", "getTarget", "(", ")", ";", "if", "(", "target"...
<p>isAFitInterpreter.</p> @param sud a {@link com.greenpepper.systemunderdevelopment.SystemUnderDevelopment} object. @param name a {@link java.lang.String} object. @return a boolean.
[ "<p", ">", "isAFitInterpreter", ".", "<", "/", "p", ">" ]
train
https://github.com/strator-dev/greenpepper-open/blob/71fd244b4989e9cd2d07ae62dd954a1f2a269a92/extensions-external/fit/src/main/java/com/greenpepper/extensions/fit/Fit.java#L75-L88
mojohaus/jaxb2-maven-plugin
src/main/java/org/codehaus/mojo/jaxb2/shared/Validate.java
Validate.notEmpty
public static void notEmpty(final String aString, final String argumentName) { """ Validates that the supplied object is not null, and throws an IllegalArgumentException otherwise. @param aString The string to validate for emptyness. @param argumentName The argument name of the object to validate. If sup...
java
public static void notEmpty(final String aString, final String argumentName) { // Check sanity notNull(aString, argumentName); if (aString.length() == 0) { throw new IllegalArgumentException(getMessage("empty", argumentName)); } }
[ "public", "static", "void", "notEmpty", "(", "final", "String", "aString", ",", "final", "String", "argumentName", ")", "{", "// Check sanity", "notNull", "(", "aString", ",", "argumentName", ")", ";", "if", "(", "aString", ".", "length", "(", ")", "==", "...
Validates that the supplied object is not null, and throws an IllegalArgumentException otherwise. @param aString The string to validate for emptyness. @param argumentName The argument name of the object to validate. If supplied (i.e. non-{@code null}), this value is used in composing a better exception message.
[ "Validates", "that", "the", "supplied", "object", "is", "not", "null", "and", "throws", "an", "IllegalArgumentException", "otherwise", "." ]
train
https://github.com/mojohaus/jaxb2-maven-plugin/blob/e3c4e47943b15282e5a6e850bbfb1588d8452a0a/src/main/java/org/codehaus/mojo/jaxb2/shared/Validate.java#L57-L65
Azure/azure-sdk-for-java
iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java
IotHubResourcesInner.getEndpointHealthAsync
public Observable<Page<EndpointHealthDataInner>> getEndpointHealthAsync(final String resourceGroupName, final String iotHubName) { """ Get the health for routing endpoints. Get the health for routing endpoints. @param resourceGroupName the String value @param iotHubName the String value @throws IllegalArgume...
java
public Observable<Page<EndpointHealthDataInner>> getEndpointHealthAsync(final String resourceGroupName, final String iotHubName) { return getEndpointHealthWithServiceResponseAsync(resourceGroupName, iotHubName) .map(new Func1<ServiceResponse<Page<EndpointHealthDataInner>>, Page<EndpointHealthDataInn...
[ "public", "Observable", "<", "Page", "<", "EndpointHealthDataInner", ">", ">", "getEndpointHealthAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "iotHubName", ")", "{", "return", "getEndpointHealthWithServiceResponseAsync", "(", "resourceGroup...
Get the health for routing endpoints. Get the health for routing endpoints. @param resourceGroupName the String value @param iotHubName the String value @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the PagedList&lt;EndpointHealthDataInner&gt; object
[ "Get", "the", "health", "for", "routing", "endpoints", ".", "Get", "the", "health", "for", "routing", "endpoints", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java#L2473-L2481
lessthanoptimal/ejml
main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF4.java
CommonOps_DDF4.fill
public static void fill( DMatrix4 a , double v ) { """ <p> Sets every element in the vector to the specified value.<br> <br> a<sub>i</sub> = value <p> @param a A vector whose elements are about to be set. Modified. @param v The value each element will have. """ a.a1 = v; a.a2 = v; ...
java
public static void fill( DMatrix4 a , double v ) { a.a1 = v; a.a2 = v; a.a3 = v; a.a4 = v; }
[ "public", "static", "void", "fill", "(", "DMatrix4", "a", ",", "double", "v", ")", "{", "a", ".", "a1", "=", "v", ";", "a", ".", "a2", "=", "v", ";", "a", ".", "a3", "=", "v", ";", "a", ".", "a4", "=", "v", ";", "}" ]
<p> Sets every element in the vector to the specified value.<br> <br> a<sub>i</sub> = value <p> @param a A vector whose elements are about to be set. Modified. @param v The value each element will have.
[ "<p", ">", "Sets", "every", "element", "in", "the", "vector", "to", "the", "specified", "value", ".", "<br", ">", "<br", ">", "a<sub", ">", "i<", "/", "sub", ">", "=", "value", "<p", ">" ]
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF4.java#L1609-L1614
line/armeria
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
ServerBuilder.accessLogFormat
public ServerBuilder accessLogFormat(String accessLogFormat) { """ Sets the format of this {@link Server}'s access log. The specified {@code accessLogFormat} would be parsed by {@link AccessLogWriter#custom(String)}. """ return accessLogWriter(AccessLogWriter.custom(requireNonNull(accessLogFormat, "ac...
java
public ServerBuilder accessLogFormat(String accessLogFormat) { return accessLogWriter(AccessLogWriter.custom(requireNonNull(accessLogFormat, "accessLogFormat")), true); }
[ "public", "ServerBuilder", "accessLogFormat", "(", "String", "accessLogFormat", ")", "{", "return", "accessLogWriter", "(", "AccessLogWriter", ".", "custom", "(", "requireNonNull", "(", "accessLogFormat", ",", "\"accessLogFormat\"", ")", ")", ",", "true", ")", ";", ...
Sets the format of this {@link Server}'s access log. The specified {@code accessLogFormat} would be parsed by {@link AccessLogWriter#custom(String)}.
[ "Sets", "the", "format", "of", "this", "{" ]
train
https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java#L695-L698
querydsl/querydsl
querydsl-sql/src/main/java/com/querydsl/sql/Configuration.java
Configuration.registerNumeric
public void registerNumeric(int beginTotal, int endTotal, int beginDecimal, int endDecimal, Class <?> javaType) { """ Override multiple numeric bindings, both begin and end are inclusive @param beginTotal inclusive start of range @param endTotal inclusive end of range @param beginDecimal inclusive start of ra...
java
public void registerNumeric(int beginTotal, int endTotal, int beginDecimal, int endDecimal, Class <?> javaType) { for (int total = beginTotal; total <= endTotal; total++) { for (int decimal = beginDecimal; decimal <= endDecimal; decimal++) { registerNumeric(total, decimal, javaType);...
[ "public", "void", "registerNumeric", "(", "int", "beginTotal", ",", "int", "endTotal", ",", "int", "beginDecimal", ",", "int", "endDecimal", ",", "Class", "<", "?", ">", "javaType", ")", "{", "for", "(", "int", "total", "=", "beginTotal", ";", "total", "...
Override multiple numeric bindings, both begin and end are inclusive @param beginTotal inclusive start of range @param endTotal inclusive end of range @param beginDecimal inclusive start of range @param endDecimal inclusive end of range @param javaType java type
[ "Override", "multiple", "numeric", "bindings", "both", "begin", "and", "end", "are", "inclusive" ]
train
https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-sql/src/main/java/com/querydsl/sql/Configuration.java#L458-L464
dain/leveldb
leveldb/src/main/java/org/iq80/leveldb/util/Slice.java
Slice.setByte
public void setByte(int index, int value) { """ Sets the specified byte at the specified absolute {@code index} in this buffer. The 24 high-order bits of the specified value are ignored. @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or {@code index + 1} is greater th...
java
public void setByte(int index, int value) { checkPositionIndexes(index, index + SIZE_OF_BYTE, this.length); index += offset; data[index] = (byte) value; }
[ "public", "void", "setByte", "(", "int", "index", ",", "int", "value", ")", "{", "checkPositionIndexes", "(", "index", ",", "index", "+", "SIZE_OF_BYTE", ",", "this", ".", "length", ")", ";", "index", "+=", "offset", ";", "data", "[", "index", "]", "="...
Sets the specified byte at the specified absolute {@code index} in this buffer. The 24 high-order bits of the specified value are ignored. @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or {@code index + 1} is greater than {@code this.capacity}
[ "Sets", "the", "specified", "byte", "at", "the", "specified", "absolute", "{", "@code", "index", "}", "in", "this", "buffer", ".", "The", "24", "high", "-", "order", "bits", "of", "the", "specified", "value", "are", "ignored", "." ]
train
https://github.com/dain/leveldb/blob/7994065b48eada2ef29e7fefd172c2ad1e0110eb/leveldb/src/main/java/org/iq80/leveldb/util/Slice.java#L347-L352
nmdp-bioinformatics/ngs
reads/src/main/java/org/nmdp/ngs/reads/paired/PairedEndFastqReader.java
PairedEndFastqReader.readPaired
public static void readPaired(final Readable firstReadable, final Readable secondReadable, final PairedEndListener listener) throws IOException { """ Read the specified paired end reads. The paired end reads are read fully into RAM before process...
java
public static void readPaired(final Readable firstReadable, final Readable secondReadable, final PairedEndListener listener) throws IOException { checkNotNull(firstReadable); checkNotNull(secondReadable); checkNotNull(listener)...
[ "public", "static", "void", "readPaired", "(", "final", "Readable", "firstReadable", ",", "final", "Readable", "secondReadable", ",", "final", "PairedEndListener", "listener", ")", "throws", "IOException", "{", "checkNotNull", "(", "firstReadable", ")", ";", "checkN...
Read the specified paired end reads. The paired end reads are read fully into RAM before processing. @param firstReadable first readable, must not be null @param secondReadable second readable, must not be null @param listener paired end listener, must not be null @throws IOException if an I/O error occurs @deprecate...
[ "Read", "the", "specified", "paired", "end", "reads", ".", "The", "paired", "end", "reads", "are", "read", "fully", "into", "RAM", "before", "processing", "." ]
train
https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/reads/src/main/java/org/nmdp/ngs/reads/paired/PairedEndFastqReader.java#L98-L154
marvinlabs/android-intents
library/src/main/java/com/marvinlabs/intents/PhoneIntents.java
PhoneIntents.newEmptySmsIntent
public static Intent newEmptySmsIntent(Context context, String phoneNumber) { """ Creates an intent that will allow to send an SMS without specifying the phone number @param phoneNumber The phone number to send the SMS to @return the intent """ return newSmsIntent(context, null, new String[]{phoneN...
java
public static Intent newEmptySmsIntent(Context context, String phoneNumber) { return newSmsIntent(context, null, new String[]{phoneNumber}); }
[ "public", "static", "Intent", "newEmptySmsIntent", "(", "Context", "context", ",", "String", "phoneNumber", ")", "{", "return", "newSmsIntent", "(", "context", ",", "null", ",", "new", "String", "[", "]", "{", "phoneNumber", "}", ")", ";", "}" ]
Creates an intent that will allow to send an SMS without specifying the phone number @param phoneNumber The phone number to send the SMS to @return the intent
[ "Creates", "an", "intent", "that", "will", "allow", "to", "send", "an", "SMS", "without", "specifying", "the", "phone", "number" ]
train
https://github.com/marvinlabs/android-intents/blob/33e79c825188b6a97601869522533cc825801f6e/library/src/main/java/com/marvinlabs/intents/PhoneIntents.java#L51-L53
codescape/bitvunit
bitvunit-core/src/main/java/de/codescape/bitvunit/report/XmlReportWriter.java
XmlReportWriter.printHeader
private void printHeader(HtmlPage htmlPage, PrintWriter out) { """ Writes the header. @param htmlPage {@link HtmlPage} that was inspected @param out target where the report is written to """ out.println("<?xml version='1.0'?>"); out.println("<BitvUnit version='" + getBitvUnitVersion() ...
java
private void printHeader(HtmlPage htmlPage, PrintWriter out) { out.println("<?xml version='1.0'?>"); out.println("<BitvUnit version='" + getBitvUnitVersion() + "'>"); out.println("<Report time='" + getFormattedDate() + "' url='" + htmlPage.getUrl().toString() + "'/>"); }
[ "private", "void", "printHeader", "(", "HtmlPage", "htmlPage", ",", "PrintWriter", "out", ")", "{", "out", ".", "println", "(", "\"<?xml version='1.0'?>\"", ")", ";", "out", ".", "println", "(", "\"<BitvUnit version='\"", "+", "getBitvUnitVersion", "(", ")", "+"...
Writes the header. @param htmlPage {@link HtmlPage} that was inspected @param out target where the report is written to
[ "Writes", "the", "header", "." ]
train
https://github.com/codescape/bitvunit/blob/cef6d9af60d684e41294981c10b6d92c8f063a4e/bitvunit-core/src/main/java/de/codescape/bitvunit/report/XmlReportWriter.java#L50-L54
GoogleCloudPlatform/bigdata-interop
gcsio/src/main/java/com/google/cloud/hadoop/gcsio/BatchHelper.java
BatchHelper.awaitRequestsCompletion
private void awaitRequestsCompletion() throws IOException { """ Awaits until all sent requests are completed. Should be serialized """ // Don't wait until all requests will be completed if enough requests are pending for full batch while (!responseFutures.isEmpty() && pendingRequests.size() < maxReques...
java
private void awaitRequestsCompletion() throws IOException { // Don't wait until all requests will be completed if enough requests are pending for full batch while (!responseFutures.isEmpty() && pendingRequests.size() < maxRequestsPerBatch) { try { responseFutures.remove().get(); } catch (Int...
[ "private", "void", "awaitRequestsCompletion", "(", ")", "throws", "IOException", "{", "// Don't wait until all requests will be completed if enough requests are pending for full batch", "while", "(", "!", "responseFutures", ".", "isEmpty", "(", ")", "&&", "pendingRequests", "."...
Awaits until all sent requests are completed. Should be serialized
[ "Awaits", "until", "all", "sent", "requests", "are", "completed", ".", "Should", "be", "serialized" ]
train
https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/BatchHelper.java#L259-L271
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/util/MathUtils.java
MathUtils.ssReg
public static double ssReg(double[] residuals, double[] targetAttribute) { """ How much of the variance is explained by the regression @param residuals error @param targetAttribute data for target attribute @return the sum squares of regression """ double mean = sum(targetAttribute) / targetAttribut...
java
public static double ssReg(double[] residuals, double[] targetAttribute) { double mean = sum(targetAttribute) / targetAttribute.length; double ret = 0; for (int i = 0; i < residuals.length; i++) { ret += Math.pow(residuals[i] - mean, 2); } return ret; }
[ "public", "static", "double", "ssReg", "(", "double", "[", "]", "residuals", ",", "double", "[", "]", "targetAttribute", ")", "{", "double", "mean", "=", "sum", "(", "targetAttribute", ")", "/", "targetAttribute", ".", "length", ";", "double", "ret", "=", ...
How much of the variance is explained by the regression @param residuals error @param targetAttribute data for target attribute @return the sum squares of regression
[ "How", "much", "of", "the", "variance", "is", "explained", "by", "the", "regression" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/util/MathUtils.java#L173-L180
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierApplications.java
TypeQualifierApplications.getApplicableScopedApplications
private static void getApplicableScopedApplications(Set<TypeQualifierAnnotation> result, AnnotatedObject o, ElementType e) { """ Populate Set of TypeQualifierAnnotations for given AnnotatedObject, taking into account annotations applied to outer scopes (e.g., enclosing classes and packages.) @param result Se...
java
private static void getApplicableScopedApplications(Set<TypeQualifierAnnotation> result, AnnotatedObject o, ElementType e) { if (!o.isSynthetic()) { AnnotatedObject outer = o.getContainingScope(); if (outer != null) { getApplicableScopedApplications(result, outer, e); ...
[ "private", "static", "void", "getApplicableScopedApplications", "(", "Set", "<", "TypeQualifierAnnotation", ">", "result", ",", "AnnotatedObject", "o", ",", "ElementType", "e", ")", "{", "if", "(", "!", "o", ".", "isSynthetic", "(", ")", ")", "{", "AnnotatedOb...
Populate Set of TypeQualifierAnnotations for given AnnotatedObject, taking into account annotations applied to outer scopes (e.g., enclosing classes and packages.) @param result Set of TypeQualifierAnnotations @param o an AnnotatedObject @param e ElementType representing kind of AnnotatedObject
[ "Populate", "Set", "of", "TypeQualifierAnnotations", "for", "given", "AnnotatedObject", "taking", "into", "account", "annotations", "applied", "to", "outer", "scopes", "(", "e", ".", "g", ".", "enclosing", "classes", "and", "packages", ".", ")" ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierApplications.java#L288-L296
UrielCh/ovh-java-sdk
ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java
ApiOvhOrder.cloud_project_serviceName_credit_GET
public OvhOrder cloud_project_serviceName_credit_GET(String serviceName, Long amount) throws IOException { """ Get prices and contracts information REST: GET /order/cloud/project/{serviceName}/credit @param amount [required] Amount to add in your cloud credit @param serviceName [required] The project id "...
java
public OvhOrder cloud_project_serviceName_credit_GET(String serviceName, Long amount) throws IOException { String qPath = "/order/cloud/project/{serviceName}/credit"; StringBuilder sb = path(qPath, serviceName); query(sb, "amount", amount); String resp = exec(qPath, "GET", sb.toString(), null); return convert...
[ "public", "OvhOrder", "cloud_project_serviceName_credit_GET", "(", "String", "serviceName", ",", "Long", "amount", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/order/cloud/project/{serviceName}/credit\"", ";", "StringBuilder", "sb", "=", "path", "(", "...
Get prices and contracts information REST: GET /order/cloud/project/{serviceName}/credit @param amount [required] Amount to add in your cloud credit @param serviceName [required] The project id
[ "Get", "prices", "and", "contracts", "information" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L2963-L2969
google/j2objc
jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java
ParserAdapter.checkNotParsing
private void checkNotParsing (String type, String name) throws SAXNotSupportedException { """ Throw an exception if we are parsing. <p>Use this method to detect illegal feature or property changes.</p> @param type The type of thing (feature or property). @param name The feature or property name. @exce...
java
private void checkNotParsing (String type, String name) throws SAXNotSupportedException { if (parsing) { throw new SAXNotSupportedException("Cannot change " + type + ' ' + name + " while parsing"); } }
[ "private", "void", "checkNotParsing", "(", "String", "type", ",", "String", "name", ")", "throws", "SAXNotSupportedException", "{", "if", "(", "parsing", ")", "{", "throw", "new", "SAXNotSupportedException", "(", "\"Cannot change \"", "+", "type", "+", "'", "'",...
Throw an exception if we are parsing. <p>Use this method to detect illegal feature or property changes.</p> @param type The type of thing (feature or property). @param name The feature or property name. @exception SAXNotSupportedException If a document is currently being parsed.
[ "Throw", "an", "exception", "if", "we", "are", "parsing", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java#L797-L806
pravega/pravega
controller/src/main/java/io/pravega/controller/server/rest/resources/StreamMetadataResourceImpl.java
StreamMetadataResourceImpl.listScopes
@Override public void listScopes(final SecurityContext securityContext, final AsyncResponse asyncResponse) { """ Implementation of listScopes REST API. @param securityContext The security for API access. @param asyncResponse AsyncResponse provides means for asynchronous server side response proce...
java
@Override public void listScopes(final SecurityContext securityContext, final AsyncResponse asyncResponse) { long traceId = LoggerHelpers.traceEnter(log, "listScopes"); final Principal principal; final List<String> authHeader = getAuthorizationHeader(); try { principal ...
[ "@", "Override", "public", "void", "listScopes", "(", "final", "SecurityContext", "securityContext", ",", "final", "AsyncResponse", "asyncResponse", ")", "{", "long", "traceId", "=", "LoggerHelpers", ".", "traceEnter", "(", "log", ",", "\"listScopes\"", ")", ";", ...
Implementation of listScopes REST API. @param securityContext The security for API access. @param asyncResponse AsyncResponse provides means for asynchronous server side response processing.
[ "Implementation", "of", "listScopes", "REST", "API", "." ]
train
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/rest/resources/StreamMetadataResourceImpl.java#L466-L509
Azure/azure-sdk-for-java
batch/data-plane/src/main/java/com/microsoft/azure/batch/FileOperations.java
FileOperations.deleteFileFromTask
public void deleteFileFromTask(String jobId, String taskId, String fileName, Boolean recursive, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException { """ Deletes the specified file from the specified task's directory on its compute node. @param jobId The ID of the job cont...
java
public void deleteFileFromTask(String jobId, String taskId, String fileName, Boolean recursive, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException { FileDeleteFromTaskOptions options = new FileDeleteFromTaskOptions(); BehaviorManager bhMgr = new BehaviorManager(th...
[ "public", "void", "deleteFileFromTask", "(", "String", "jobId", ",", "String", "taskId", ",", "String", "fileName", ",", "Boolean", "recursive", ",", "Iterable", "<", "BatchClientBehavior", ">", "additionalBehaviors", ")", "throws", "BatchErrorException", ",", "IOEx...
Deletes the specified file from the specified task's directory on its compute node. @param jobId The ID of the job containing the task. @param taskId The ID of the task. @param fileName The name of the file to delete. @param recursive If the file-path parameter represents a directory instead of a file, you can set the...
[ "Deletes", "the", "specified", "file", "from", "the", "specified", "task", "s", "directory", "on", "its", "compute", "node", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/FileOperations.java#L200-L206
Azure/azure-sdk-for-java
kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasesInner.java
DatabasesInner.addPrincipals
public DatabasePrincipalListResultInner addPrincipals(String resourceGroupName, String clusterName, String databaseName, List<DatabasePrincipalInner> value) { """ Add Database principals permissions. @param resourceGroupName The name of the resource group containing the Kusto cluster. @param clusterName The na...
java
public DatabasePrincipalListResultInner addPrincipals(String resourceGroupName, String clusterName, String databaseName, List<DatabasePrincipalInner> value) { return addPrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, value).toBlocking().single().body(); }
[ "public", "DatabasePrincipalListResultInner", "addPrincipals", "(", "String", "resourceGroupName", ",", "String", "clusterName", ",", "String", "databaseName", ",", "List", "<", "DatabasePrincipalInner", ">", "value", ")", "{", "return", "addPrincipalsWithServiceResponseAsy...
Add Database principals permissions. @param resourceGroupName The name of the resource group containing the Kusto cluster. @param clusterName The name of the Kusto cluster. @param databaseName The name of the database in the Kusto cluster. @param value The list of Kusto database principals. @throws IllegalArgumentExce...
[ "Add", "Database", "principals", "permissions", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasesInner.java#L1135-L1137
kotcrab/vis-ui
ui/src/main/java/com/kotcrab/vis/ui/util/ColorUtils.java
ColorUtils.RGBtoHSV
public static int[] RGBtoHSV (Color c) { """ Converts {@link Color} to HSV color system @return 3 element int array with hue (0-360), saturation (0-100) and value (0-100) """ return RGBtoHSV(c.r, c.g, c.b); }
java
public static int[] RGBtoHSV (Color c) { return RGBtoHSV(c.r, c.g, c.b); }
[ "public", "static", "int", "[", "]", "RGBtoHSV", "(", "Color", "c", ")", "{", "return", "RGBtoHSV", "(", "c", ".", "r", ",", "c", ".", "g", ",", "c", ".", "b", ")", ";", "}" ]
Converts {@link Color} to HSV color system @return 3 element int array with hue (0-360), saturation (0-100) and value (0-100)
[ "Converts", "{" ]
train
https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/ColorUtils.java#L119-L121
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/field/PropertiesField.java
PropertiesField.setProperties
public int setProperties(Map<String,Object> properties, boolean bDisplayOption, int iMoveMode) { """ Set this property in the user's property area. @param strProperty The property key. @param strValue The property value. @param iDisplayOption If true, display the new field. @param iMoveMove The move mode. @re...
java
public int setProperties(Map<String,Object> properties, boolean bDisplayOption, int iMoveMode) { m_propertiesCache = properties; if ((properties == null) || (properties.size() == 0)) m_propertiesCache = null; String strProperties = null; if (m_propertiesCache != null) ...
[ "public", "int", "setProperties", "(", "Map", "<", "String", ",", "Object", ">", "properties", ",", "boolean", "bDisplayOption", ",", "int", "iMoveMode", ")", "{", "m_propertiesCache", "=", "properties", ";", "if", "(", "(", "properties", "==", "null", ")", ...
Set this property in the user's property area. @param strProperty The property key. @param strValue The property value. @param iDisplayOption If true, display the new field. @param iMoveMove The move mode. @return An error code (NORMAL_RETURN for success).
[ "Set", "this", "property", "in", "the", "user", "s", "property", "area", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/PropertiesField.java#L189-L201
lucee/Lucee
core/src/main/java/lucee/intergral/fusiondebug/server/FDStackFrameImpl.java
FDStackFrameImpl.copyValues
private static List copyValues(FDStackFrameImpl frame, List to, Struct from) { """ copy all data from given struct to given list and translate it to a FDValue @param to list to fill with values @param from struct to read values from @return the given list """ Iterator it = from.entrySet().iterator(); En...
java
private static List copyValues(FDStackFrameImpl frame, List to, Struct from) { Iterator it = from.entrySet().iterator(); Entry entry; while (it.hasNext()) { entry = (Entry) it.next(); to.add(new FDVariable(frame, (String) entry.getKey(), FDCaster.toFDValue(frame, entry.getValue()))); } return to; }
[ "private", "static", "List", "copyValues", "(", "FDStackFrameImpl", "frame", ",", "List", "to", ",", "Struct", "from", ")", "{", "Iterator", "it", "=", "from", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "Entry", "entry", ";", "while", "...
copy all data from given struct to given list and translate it to a FDValue @param to list to fill with values @param from struct to read values from @return the given list
[ "copy", "all", "data", "from", "given", "struct", "to", "given", "list", "and", "translate", "it", "to", "a", "FDValue" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/intergral/fusiondebug/server/FDStackFrameImpl.java#L208-L216
the-fascinator/plugin-subscriber-solrEventLog
src/main/java/com/googlecode/fascinator/subscriber/solrEventLog/SolrEventLogSubscriber.java
SolrEventLogSubscriber.addToIndex
private void addToIndex(Map<String, String> param) throws Exception { """ Add the event to the index @param param : Map of key/value pairs to add to the index @throws Exception if there was an error """ String doc = writeUpdateString(param); addToBuffer(doc); }
java
private void addToIndex(Map<String, String> param) throws Exception { String doc = writeUpdateString(param); addToBuffer(doc); }
[ "private", "void", "addToIndex", "(", "Map", "<", "String", ",", "String", ">", "param", ")", "throws", "Exception", "{", "String", "doc", "=", "writeUpdateString", "(", "param", ")", ";", "addToBuffer", "(", "doc", ")", ";", "}" ]
Add the event to the index @param param : Map of key/value pairs to add to the index @throws Exception if there was an error
[ "Add", "the", "event", "to", "the", "index" ]
train
https://github.com/the-fascinator/plugin-subscriber-solrEventLog/blob/2c9da188887a622a6d43d33ea9099aff53a0516d/src/main/java/com/googlecode/fascinator/subscriber/solrEventLog/SolrEventLogSubscriber.java#L437-L440
kohsuke/args4j
args4j/src/org/kohsuke/args4j/CmdLineParser.java
CmdLineParser.createOptionHandler
protected OptionHandler createOptionHandler(OptionDef o, Setter setter) { """ Creates an {@link OptionHandler} that handles the given {@link Option} annotation and the {@link Setter} instance. """ checkNonNull(o, "OptionDef"); checkNonNull(setter, "Setter"); return OptionHandlerRegistr...
java
protected OptionHandler createOptionHandler(OptionDef o, Setter setter) { checkNonNull(o, "OptionDef"); checkNonNull(setter, "Setter"); return OptionHandlerRegistry.getRegistry().createOptionHandler(this, o, setter); }
[ "protected", "OptionHandler", "createOptionHandler", "(", "OptionDef", "o", ",", "Setter", "setter", ")", "{", "checkNonNull", "(", "o", ",", "\"OptionDef\"", ")", ";", "checkNonNull", "(", "setter", ",", "\"Setter\"", ")", ";", "return", "OptionHandlerRegistry", ...
Creates an {@link OptionHandler} that handles the given {@link Option} annotation and the {@link Setter} instance.
[ "Creates", "an", "{" ]
train
https://github.com/kohsuke/args4j/blob/dc2e7e265caf15a1a146e3389c1f16a8781f06cf/args4j/src/org/kohsuke/args4j/CmdLineParser.java#L175-L179
gallandarakhneorg/afc
core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/filetype/XSLBasedXMLMagicNumber.java
XSLBasedXMLMagicNumber.isContentType
@Override protected boolean isContentType(String schemaId, String schemaVersion, String systemId, String publicId) { """ Replies if the specified stream contains data that corresponds to this magic number. @param schemaId is the ID of the XSL schema associated to this magic number. @param schemaVersion is th...
java
@Override protected boolean isContentType(String schemaId, String schemaVersion, String systemId, String publicId) { if (this.schema == null) { return false; } if (this.regEx != null) { final Matcher matcher = this.regEx.matcher(schemaId); return matcher != null && matcher.find(); } return this.sche...
[ "@", "Override", "protected", "boolean", "isContentType", "(", "String", "schemaId", ",", "String", "schemaVersion", ",", "String", "systemId", ",", "String", "publicId", ")", "{", "if", "(", "this", ".", "schema", "==", "null", ")", "{", "return", "false", ...
Replies if the specified stream contains data that corresponds to this magic number. @param schemaId is the ID of the XSL schema associated to this magic number. @param schemaVersion is the ID of the XSL schema associated to this magic number. @param systemId is the DTD system ID associated to this magic number. @para...
[ "Replies", "if", "the", "specified", "stream", "contains", "data", "that", "corresponds", "to", "this", "magic", "number", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/filetype/XSLBasedXMLMagicNumber.java#L110-L120
Pi4J/pi4j
pi4j-core/src/main/java/com/pi4j/io/gpio/BananaProPin.java
BananaProPin.createDigitalPin
protected static Pin createDigitalPin(int address, String name) { """ this pin is permanently pulled up; pin pull settings do not work """ return createDigitalPin(BananaProGpioProvider.NAME, address, name); }
java
protected static Pin createDigitalPin(int address, String name) { return createDigitalPin(BananaProGpioProvider.NAME, address, name); }
[ "protected", "static", "Pin", "createDigitalPin", "(", "int", "address", ",", "String", "name", ")", "{", "return", "createDigitalPin", "(", "BananaProGpioProvider", ".", "NAME", ",", "address", ",", "name", ")", ";", "}" ]
this pin is permanently pulled up; pin pull settings do not work
[ "this", "pin", "is", "permanently", "pulled", "up", ";", "pin", "pull", "settings", "do", "not", "work" ]
train
https://github.com/Pi4J/pi4j/blob/03cacc62223cc59b3118bfcefadabab979fd84c7/pi4j-core/src/main/java/com/pi4j/io/gpio/BananaProPin.java#L76-L78
overturetool/overture
ide/debug/src/main/java/org/overture/ide/debug/ui/propertypages/VdmBreakpointPropertyPage.java
VdmBreakpointPropertyPage.createCheckButton
protected Button createCheckButton(Composite parent, String text) { """ Creates a fully configured check button with the given text. @param parent the parent composite @param text the label of the returned check button @return a fully configured check button """ return SWTFactory.createCheckButton(par...
java
protected Button createCheckButton(Composite parent, String text) { return SWTFactory.createCheckButton(parent, text, null, false, 1); }
[ "protected", "Button", "createCheckButton", "(", "Composite", "parent", ",", "String", "text", ")", "{", "return", "SWTFactory", ".", "createCheckButton", "(", "parent", ",", "text", ",", "null", ",", "false", ",", "1", ")", ";", "}" ]
Creates a fully configured check button with the given text. @param parent the parent composite @param text the label of the returned check button @return a fully configured check button
[ "Creates", "a", "fully", "configured", "check", "button", "with", "the", "given", "text", "." ]
train
https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/ide/debug/src/main/java/org/overture/ide/debug/ui/propertypages/VdmBreakpointPropertyPage.java#L504-L507
groupon/odo
client/src/main/java/com/groupon/odo/client/PathValueClient.java
PathValueClient.removeCustomResponse
public boolean removeCustomResponse(String pathValue, String requestType) { """ Remove any overrides for an endpoint @param pathValue path (endpoint) value @param requestType path request type. "GET", "POST", etc @return true if success, false otherwise """ try { JSONObject path = getP...
java
public boolean removeCustomResponse(String pathValue, String requestType) { try { JSONObject path = getPathFromEndpoint(pathValue, requestType); if (path == null) { return false; } String pathId = path.getString("pathId"); return resetR...
[ "public", "boolean", "removeCustomResponse", "(", "String", "pathValue", ",", "String", "requestType", ")", "{", "try", "{", "JSONObject", "path", "=", "getPathFromEndpoint", "(", "pathValue", ",", "requestType", ")", ";", "if", "(", "path", "==", "null", ")",...
Remove any overrides for an endpoint @param pathValue path (endpoint) value @param requestType path request type. "GET", "POST", etc @return true if success, false otherwise
[ "Remove", "any", "overrides", "for", "an", "endpoint" ]
train
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/PathValueClient.java#L103-L115
JavaMoney/jsr354-api
src/main/java/javax/money/Monetary.java
Monetary.getRounding
public static MonetaryRounding getRounding(String roundingName, String... providers) { """ Access an {@link MonetaryOperator} for custom rounding {@link MonetaryAmount} instances. @param roundingName The rounding identifier. @param providers the providers and ordering to be used. By default providers and o...
java
public static MonetaryRounding getRounding(String roundingName, String... providers) { return Optional.ofNullable(monetaryRoundingsSingletonSpi()).orElseThrow( () -> new MonetaryException("No MonetaryRoundingsSpi loaded, query functionality is not available.")) .getRounding(round...
[ "public", "static", "MonetaryRounding", "getRounding", "(", "String", "roundingName", ",", "String", "...", "providers", ")", "{", "return", "Optional", ".", "ofNullable", "(", "monetaryRoundingsSingletonSpi", "(", ")", ")", ".", "orElseThrow", "(", "(", ")", "-...
Access an {@link MonetaryOperator} for custom rounding {@link MonetaryAmount} instances. @param roundingName The rounding identifier. @param providers the providers and ordering to be used. By default providers and ordering as defined in #getDefaultProviders is used. @return the corresponding {@link MonetaryOperato...
[ "Access", "an", "{", "@link", "MonetaryOperator", "}", "for", "custom", "rounding", "{", "@link", "MonetaryAmount", "}", "instances", "." ]
train
https://github.com/JavaMoney/jsr354-api/blob/49a7ae436eaf45cac1040879185531ef22de5525/src/main/java/javax/money/Monetary.java#L171-L175
GenesysPureEngage/workspace-client-java
src/main/java/com/genesys/internal/workspace/api/MediaApi.java
MediaApi.addAttachment
public ApiSuccessResponse addAttachment(String mediatype, String id, File attachment, String operationId) throws ApiException { """ Add an attachment to the open-media interaction Add an attachment to the interaction specified in the id path parameter @param mediatype media-type of interaction to add attachment ...
java
public ApiSuccessResponse addAttachment(String mediatype, String id, File attachment, String operationId) throws ApiException { ApiResponse<ApiSuccessResponse> resp = addAttachmentWithHttpInfo(mediatype, id, attachment, operationId); return resp.getData(); }
[ "public", "ApiSuccessResponse", "addAttachment", "(", "String", "mediatype", ",", "String", "id", ",", "File", "attachment", ",", "String", "operationId", ")", "throws", "ApiException", "{", "ApiResponse", "<", "ApiSuccessResponse", ">", "resp", "=", "addAttachmentW...
Add an attachment to the open-media interaction Add an attachment to the interaction specified in the id path parameter @param mediatype media-type of interaction to add attachment (required) @param id id of interaction (required) @param attachment The file to upload. (optional) @param operationId operationId associate...
[ "Add", "an", "attachment", "to", "the", "open", "-", "media", "interaction", "Add", "an", "attachment", "to", "the", "interaction", "specified", "in", "the", "id", "path", "parameter" ]
train
https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/MediaApi.java#L313-L316
intendia-oss/rxjava-gwt
src/main/modified/io/reactivex/super/io/reactivex/Observable.java
Observable.fromFuture
@CheckReturnValue @SchedulerSupport(SchedulerSupport.CUSTOM) public static <T> Observable<T> fromFuture(Future<? extends T> future, long timeout, TimeUnit unit, Scheduler scheduler) { """ Converts a {@link Future} into an ObservableSource, with a timeout on the Future. <p> <img width="640" height="287" s...
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.CUSTOM) public static <T> Observable<T> fromFuture(Future<? extends T> future, long timeout, TimeUnit unit, Scheduler scheduler) { ObjectHelper.requireNonNull(scheduler, "scheduler is null"); Observable<T> o = fromFuture(future, timeout, unit)...
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "CUSTOM", ")", "public", "static", "<", "T", ">", "Observable", "<", "T", ">", "fromFuture", "(", "Future", "<", "?", "extends", "T", ">", "future", ",", "long", "timeout", ","...
Converts a {@link Future} into an ObservableSource, with a timeout on the Future. <p> <img width="640" height="287" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/fromFuture.timeout.scheduler.png" alt=""> <p> You can convert any object that supports the {@link Future} interface into an Observable...
[ "Converts", "a", "{", "@link", "Future", "}", "into", "an", "ObservableSource", "with", "a", "timeout", "on", "the", "Future", ".", "<p", ">", "<img", "width", "=", "640", "height", "=", "287", "src", "=", "https", ":", "//", "raw", ".", "github", "....
train
https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Observable.java#L1888-L1894
stratosphere/stratosphere
stratosphere-runtime/src/main/java/eu/stratosphere/nephele/execution/RuntimeEnvironment.java
RuntimeEnvironment.getExecutingThread
public Thread getExecutingThread() { """ Returns the thread which is assigned to execute the user code. @return the thread which is assigned to execute the user code """ synchronized (this) { if (this.executingThread == null) { if (this.taskName == null) { this.executingThread = new Thread(th...
java
public Thread getExecutingThread() { synchronized (this) { if (this.executingThread == null) { if (this.taskName == null) { this.executingThread = new Thread(this); } else { this.executingThread = new Thread(this, getTaskNameWithIndex()); } } return this.executingThread; } }
[ "public", "Thread", "getExecutingThread", "(", ")", "{", "synchronized", "(", "this", ")", "{", "if", "(", "this", ".", "executingThread", "==", "null", ")", "{", "if", "(", "this", ".", "taskName", "==", "null", ")", "{", "this", ".", "executingThread",...
Returns the thread which is assigned to execute the user code. @return the thread which is assigned to execute the user code
[ "Returns", "the", "thread", "which", "is", "assigned", "to", "execute", "the", "user", "code", "." ]
train
https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/execution/RuntimeEnvironment.java#L421-L435
apache/incubator-atlas
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java
DeleteHandlerV1.deleteEntities
public void deleteEntities(Collection<AtlasVertex> instanceVertices) throws AtlasBaseException { """ Deletes the specified entity vertices. Deletes any traits, composite entities, and structs owned by each entity. Also deletes all the references from/to the entity. @param instanceVertices @throws AtlasExcept...
java
public void deleteEntities(Collection<AtlasVertex> instanceVertices) throws AtlasBaseException { RequestContextV1 requestContext = RequestContextV1.get(); Set<AtlasVertex> deletionCandidateVertices = new HashSet<>(); for (AtlasVertex instanceVertex : instanceVertices) { String ...
[ "public", "void", "deleteEntities", "(", "Collection", "<", "AtlasVertex", ">", "instanceVertices", ")", "throws", "AtlasBaseException", "{", "RequestContextV1", "requestContext", "=", "RequestContextV1", ".", "get", "(", ")", ";", "Set", "<", "AtlasVertex", ">", ...
Deletes the specified entity vertices. Deletes any traits, composite entities, and structs owned by each entity. Also deletes all the references from/to the entity. @param instanceVertices @throws AtlasException
[ "Deletes", "the", "specified", "entity", "vertices", ".", "Deletes", "any", "traits", "composite", "entities", "and", "structs", "owned", "by", "each", "entity", ".", "Also", "deletes", "all", "the", "references", "from", "/", "to", "the", "entity", "." ]
train
https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java#L85-L123
spotbugs/spotbugs
eclipsePlugin/src/edu/umd/cs/findbugs/plugin/eclipse/quickfix/util/ASTUtil.java
ASTUtil.getMethodDeclaration
public static MethodDeclaration getMethodDeclaration(TypeDeclaration type, MethodAnnotation methodAnno) throws MethodDeclarationNotFoundException { """ Returns the <CODE>MethodDeclaration</CODE> for the specified <CODE>MethodAnnotation</CODE>. The method has to be declared in the specified <CODE>Type...
java
public static MethodDeclaration getMethodDeclaration(TypeDeclaration type, MethodAnnotation methodAnno) throws MethodDeclarationNotFoundException { Objects.requireNonNull(methodAnno, "method annotation"); return getMethodDeclaration(type, methodAnno.getMethodName(), methodAnno.getMethodSign...
[ "public", "static", "MethodDeclaration", "getMethodDeclaration", "(", "TypeDeclaration", "type", ",", "MethodAnnotation", "methodAnno", ")", "throws", "MethodDeclarationNotFoundException", "{", "Objects", ".", "requireNonNull", "(", "methodAnno", ",", "\"method annotation\"",...
Returns the <CODE>MethodDeclaration</CODE> for the specified <CODE>MethodAnnotation</CODE>. The method has to be declared in the specified <CODE>TypeDeclaration</CODE>. @param type The <CODE>TypeDeclaration</CODE>, where the <CODE>MethodDeclaration</CODE> is declared in. @param methodAnno The <CODE>MethodAnnotation</C...
[ "Returns", "the", "<CODE", ">", "MethodDeclaration<", "/", "CODE", ">", "for", "the", "specified", "<CODE", ">", "MethodAnnotation<", "/", "CODE", ">", ".", "The", "method", "has", "to", "be", "declared", "in", "the", "specified", "<CODE", ">", "TypeDeclarat...
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/edu/umd/cs/findbugs/plugin/eclipse/quickfix/util/ASTUtil.java#L338-L343
powermock/powermock
powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java
PowerMock.createPartialMock
public static <T> T createPartialMock(Class<T> type, String[] methodNames, Object... constructorArguments) { """ A utility method that may be used to mock several methods in an easy way (by just passing in the method names of the method you wish to mock). The mock object created will support mocking of final and...
java
public static <T> T createPartialMock(Class<T> type, String[] methodNames, Object... constructorArguments) { Constructor<?> constructor = WhiteboxImpl.findUniqueConstructorOrThrowException(type, constructorArguments); ConstructorArgs constructorArgs = new ConstructorArgs(constructor, constructorArgument...
[ "public", "static", "<", "T", ">", "T", "createPartialMock", "(", "Class", "<", "T", ">", "type", ",", "String", "[", "]", "methodNames", ",", "Object", "...", "constructorArguments", ")", "{", "Constructor", "<", "?", ">", "constructor", "=", "WhiteboxImp...
A utility method that may be used to mock several methods in an easy way (by just passing in the method names of the method you wish to mock). The mock object created will support mocking of final and native methods and invokes a specific constructor based on the supplied argument values. @param <T> t...
[ "A", "utility", "method", "that", "may", "be", "used", "to", "mock", "several", "methods", "in", "an", "easy", "way", "(", "by", "just", "passing", "in", "the", "method", "names", "of", "the", "method", "you", "wish", "to", "mock", ")", ".", "The", "...
train
https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L903-L907
bit3/jsass
src/main/java/io/bit3/jsass/Compiler.java
Compiler.compileFile
public Output compileFile(URI inputPath, URI outputPath, Options options) throws CompilationException { """ Compile file. @param inputPath The input path. @param outputPath The output path. @param options The compile options. @return The compilation output. @throws CompilationException If the comp...
java
public Output compileFile(URI inputPath, URI outputPath, Options options) throws CompilationException { FileContext context = new FileContext(inputPath, outputPath, options); return compile(context); }
[ "public", "Output", "compileFile", "(", "URI", "inputPath", ",", "URI", "outputPath", ",", "Options", "options", ")", "throws", "CompilationException", "{", "FileContext", "context", "=", "new", "FileContext", "(", "inputPath", ",", "outputPath", ",", "options", ...
Compile file. @param inputPath The input path. @param outputPath The output path. @param options The compile options. @return The compilation output. @throws CompilationException If the compilation failed.
[ "Compile", "file", "." ]
train
https://github.com/bit3/jsass/blob/fba91d5cb1eb507c7cfde5a261e04b1d328cb1ef/src/main/java/io/bit3/jsass/Compiler.java#L76-L80
alkacon/opencms-core
src/org/opencms/db/CmsDriverManager.java
CmsDriverManager.setSubscribedResourceAsDeleted
public void setSubscribedResourceAsDeleted(CmsDbContext dbc, String poolName, CmsResource resource) throws CmsException { """ Marks a subscribed resource as deleted.<p> @param dbc the database context @param poolName the name of the database pool to use @param resource the subscribed resource to mark as d...
java
public void setSubscribedResourceAsDeleted(CmsDbContext dbc, String poolName, CmsResource resource) throws CmsException { getSubscriptionDriver().setSubscribedResourceAsDeleted(dbc, poolName, resource); }
[ "public", "void", "setSubscribedResourceAsDeleted", "(", "CmsDbContext", "dbc", ",", "String", "poolName", ",", "CmsResource", "resource", ")", "throws", "CmsException", "{", "getSubscriptionDriver", "(", ")", ".", "setSubscribedResourceAsDeleted", "(", "dbc", ",", "p...
Marks a subscribed resource as deleted.<p> @param dbc the database context @param poolName the name of the database pool to use @param resource the subscribed resource to mark as deleted @throws CmsException if something goes wrong
[ "Marks", "a", "subscribed", "resource", "as", "deleted", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L9021-L9025
grails/grails-core
grails-core/src/main/groovy/org/grails/spring/context/support/PluginAwareResourceBundleMessageSource.java
PluginAwareResourceBundleMessageSource.resolveCodeWithoutArgumentsFromPlugins
protected String resolveCodeWithoutArgumentsFromPlugins(String code, Locale locale) { """ Attempts to resolve a String for the code from the list of plugin base names @param code The code @param locale The locale @return a MessageFormat """ if (pluginCacheMillis < 0) { PropertiesHolder...
java
protected String resolveCodeWithoutArgumentsFromPlugins(String code, Locale locale) { if (pluginCacheMillis < 0) { PropertiesHolder propHolder = getMergedPluginProperties(locale); String result = propHolder.getProperty(code); if (result != null) { return resul...
[ "protected", "String", "resolveCodeWithoutArgumentsFromPlugins", "(", "String", "code", ",", "Locale", "locale", ")", "{", "if", "(", "pluginCacheMillis", "<", "0", ")", "{", "PropertiesHolder", "propHolder", "=", "getMergedPluginProperties", "(", "locale", ")", ";"...
Attempts to resolve a String for the code from the list of plugin base names @param code The code @param locale The locale @return a MessageFormat
[ "Attempts", "to", "resolve", "a", "String", "for", "the", "code", "from", "the", "list", "of", "plugin", "base", "names" ]
train
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/spring/context/support/PluginAwareResourceBundleMessageSource.java#L195-L209
geomajas/geomajas-project-client-gwt2
plugin/wms/server-extension/src/main/java/org/geomajas/gwt2/plugin/wms/client/WmsServerExtension.java
WmsServerExtension.createLayer
public FeatureSearchSupportedWmsServerLayer createLayer(String title, String crs, TileConfiguration tileConfig, WmsLayerConfiguration layerConfig, WmsLayerInfo layerInfo, WfsFeatureTypeDescriptionInfo wfsConfig) { """ Create a new WMS layer. This layer extends the default {@link org.geomajas.gwt2.plugin.wms.cli...
java
public FeatureSearchSupportedWmsServerLayer createLayer(String title, String crs, TileConfiguration tileConfig, WmsLayerConfiguration layerConfig, WmsLayerInfo layerInfo, WfsFeatureTypeDescriptionInfo wfsConfig) { return new FeatureSearchSupportedWmsServerLayer(title, crs, layerConfig, tileConfig, layerInfo, wfsCo...
[ "public", "FeatureSearchSupportedWmsServerLayer", "createLayer", "(", "String", "title", ",", "String", "crs", ",", "TileConfiguration", "tileConfig", ",", "WmsLayerConfiguration", "layerConfig", ",", "WmsLayerInfo", "layerInfo", ",", "WfsFeatureTypeDescriptionInfo", "wfsConf...
Create a new WMS layer. This layer extends the default {@link org.geomajas.gwt2.plugin.wms.client.layer.WmsLayer} by supporting GetFeatureInfo calls. @param title The layer title. @param crs The CRS for this layer. @param tileConfig The tile configuration object. @param layerConfig The layer configuration object. @par...
[ "Create", "a", "new", "WMS", "layer", ".", "This", "layer", "extends", "the", "default", "{", "@link", "org", ".", "geomajas", ".", "gwt2", ".", "plugin", ".", "wms", ".", "client", ".", "layer", ".", "WmsLayer", "}", "by", "supporting", "GetFeatureInfo"...
train
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/wms/server-extension/src/main/java/org/geomajas/gwt2/plugin/wms/client/WmsServerExtension.java#L173-L176
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/util/FeatureUtil.java
FeatureUtil.scaleMinMax
public static void scaleMinMax(double min, double max, INDArray toScale) { """ Scales the ndarray columns to the given min/max values @param min the minimum number @param max the max number """ //X_std = (X - X.min(axis=0)) / (X.max(axis=0) - X.min(axis=0)) X_scaled = X_std * (max - min) + min ...
java
public static void scaleMinMax(double min, double max, INDArray toScale) { //X_std = (X - X.min(axis=0)) / (X.max(axis=0) - X.min(axis=0)) X_scaled = X_std * (max - min) + min INDArray min2 = toScale.min(0); INDArray max2 = toScale.max(0); INDArray std = toScale.subRowVector(min2).divi...
[ "public", "static", "void", "scaleMinMax", "(", "double", "min", ",", "double", "max", ",", "INDArray", "toScale", ")", "{", "//X_std = (X - X.min(axis=0)) / (X.max(axis=0) - X.min(axis=0)) X_scaled = X_std * (max - min) + min", "INDArray", "min2", "=", "toScale", ".", "min...
Scales the ndarray columns to the given min/max values @param min the minimum number @param max the max number
[ "Scales", "the", "ndarray", "columns", "to", "the", "given", "min", "/", "max", "values" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/util/FeatureUtil.java#L91-L101
gwtbootstrap3/gwtbootstrap3-extras
src/main/java/org/gwtbootstrap3/extras/animate/client/ui/Animate.java
Animate.removeAnimationOnEnd
public static final <T extends UIObject> void removeAnimationOnEnd(final T widget, final String animation) { """ Removes custom animation class on animation end. @param widget Element to remove style from. @param animation Animation CSS class to remove. """ if (widget != null && animation != null) ...
java
public static final <T extends UIObject> void removeAnimationOnEnd(final T widget, final String animation) { if (widget != null && animation != null) { removeAnimationOnEnd(widget.getElement(), animation); } }
[ "public", "static", "final", "<", "T", "extends", "UIObject", ">", "void", "removeAnimationOnEnd", "(", "final", "T", "widget", ",", "final", "String", "animation", ")", "{", "if", "(", "widget", "!=", "null", "&&", "animation", "!=", "null", ")", "{", "...
Removes custom animation class on animation end. @param widget Element to remove style from. @param animation Animation CSS class to remove.
[ "Removes", "custom", "animation", "class", "on", "animation", "end", "." ]
train
https://github.com/gwtbootstrap3/gwtbootstrap3-extras/blob/8e42aaffd2a082e9cb23a14c37a3c87b7cbdfa94/src/main/java/org/gwtbootstrap3/extras/animate/client/ui/Animate.java#L307-L311
pressgang-ccms/PressGangCCMSBuilder
src/main/java/org/jboss/pressgang/ccms/contentspec/builder/DocBookBuilder.java
DocBookBuilder.doPopulateDatabasePass
@SuppressWarnings("unchecked") private void doPopulateDatabasePass(final BuildData buildData) throws BuildProcessingException { """ Populates the SpecTopicDatabase with the SpecTopics inside the content specification. It also adds the equivalent real topics to each SpecTopic. @param buildData Information a...
java
@SuppressWarnings("unchecked") private void doPopulateDatabasePass(final BuildData buildData) throws BuildProcessingException { log.info("Doing " + buildData.getBuildLocale() + " Populate Database Pass"); final ContentSpec contentSpec = buildData.getContentSpec(); final Map<String, BaseTopi...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "void", "doPopulateDatabasePass", "(", "final", "BuildData", "buildData", ")", "throws", "BuildProcessingException", "{", "log", ".", "info", "(", "\"Doing \"", "+", "buildData", ".", "getBuildLocale", "...
Populates the SpecTopicDatabase with the SpecTopics inside the content specification. It also adds the equivalent real topics to each SpecTopic. @param buildData Information and data structures for the build. @return True if the database was populated successfully otherwise false. @throws BuildProcessingException Thro...
[ "Populates", "the", "SpecTopicDatabase", "with", "the", "SpecTopics", "inside", "the", "content", "specification", ".", "It", "also", "adds", "the", "equivalent", "real", "topics", "to", "each", "SpecTopic", "." ]
train
https://github.com/pressgang-ccms/PressGangCCMSBuilder/blob/5436d36ba1b3c5baa246b270e5fc350e6778bce8/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/DocBookBuilder.java#L718-L746
sjamesr/jfreesane
src/main/java/au/com/southsky/jfreesane/SaneSession.java
SaneSession.withRemoteSane
public static SaneSession withRemoteSane( InetAddress saneAddress, long timeout, TimeUnit timeUnit, long soTimeout, TimeUnit soTimeUnit) throws IOException { """ Establishes a connection to the SANE daemon running on the given host on the default SANE port with the given connection timeout. """ ...
java
public static SaneSession withRemoteSane( InetAddress saneAddress, long timeout, TimeUnit timeUnit, long soTimeout, TimeUnit soTimeUnit) throws IOException { return withRemoteSane(saneAddress, DEFAULT_PORT, timeout, timeUnit, soTimeout, soTimeUnit); }
[ "public", "static", "SaneSession", "withRemoteSane", "(", "InetAddress", "saneAddress", ",", "long", "timeout", ",", "TimeUnit", "timeUnit", ",", "long", "soTimeout", ",", "TimeUnit", "soTimeUnit", ")", "throws", "IOException", "{", "return", "withRemoteSane", "(", ...
Establishes a connection to the SANE daemon running on the given host on the default SANE port with the given connection timeout.
[ "Establishes", "a", "connection", "to", "the", "SANE", "daemon", "running", "on", "the", "given", "host", "on", "the", "default", "SANE", "port", "with", "the", "given", "connection", "timeout", "." ]
train
https://github.com/sjamesr/jfreesane/blob/15ad0f73df0a8d0efec5167a2141cbd53afd862d/src/main/java/au/com/southsky/jfreesane/SaneSession.java#L67-L71
graknlabs/grakn
server/src/graql/executor/ComputeExecutor.java
ComputeExecutor.scopeContainsInstances
private boolean scopeContainsInstances(GraqlCompute query, ConceptId... ids) { """ Helper method to check if concept instances exist in the query scope @param ids @return true if they exist, false if they don't """ for (ConceptId id : ids) { Thing thing = tx.getConcept(id); ...
java
private boolean scopeContainsInstances(GraqlCompute query, ConceptId... ids) { for (ConceptId id : ids) { Thing thing = tx.getConcept(id); if (thing == null || !scopeTypeLabels(query).contains(thing.type().label())) return false; } return true; }
[ "private", "boolean", "scopeContainsInstances", "(", "GraqlCompute", "query", ",", "ConceptId", "...", "ids", ")", "{", "for", "(", "ConceptId", "id", ":", "ids", ")", "{", "Thing", "thing", "=", "tx", ".", "getConcept", "(", "id", ")", ";", "if", "(", ...
Helper method to check if concept instances exist in the query scope @param ids @return true if they exist, false if they don't
[ "Helper", "method", "to", "check", "if", "concept", "instances", "exist", "in", "the", "query", "scope" ]
train
https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/graql/executor/ComputeExecutor.java#L789-L795
unbescape/unbescape
src/main/java/org/unbescape/properties/PropertiesEscape.java
PropertiesEscape.unescapeProperties
public static void unescapeProperties(final Reader reader, final Writer writer) throws IOException { """ <p> Perform a Java Properties (key or value) <strong>unescape</strong> operation on a <tt>Reader</tt> input, writing results to a <tt>Writer</tt>. </p> <p> No additional configuration arguments...
java
public static void unescapeProperties(final Reader reader, final Writer writer) throws IOException { if (writer == null) { throw new IllegalArgumentException("Argument 'writer' cannot be null"); } PropertiesUnescapeUtil.unescape(reader, writer); }
[ "public", "static", "void", "unescapeProperties", "(", "final", "Reader", "reader", ",", "final", "Writer", "writer", ")", "throws", "IOException", "{", "if", "(", "writer", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Argument 'wr...
<p> Perform a Java Properties (key or value) <strong>unescape</strong> operation on a <tt>Reader</tt> input, writing results to a <tt>Writer</tt>. </p> <p> No additional configuration arguments are required. Unescape operations will always perform <em>complete</em> Java Properties unescape of SECs and u-based escapes. ...
[ "<p", ">", "Perform", "a", "Java", "Properties", "(", "key", "or", "value", ")", "<strong", ">", "unescape<", "/", "strong", ">", "operation", "on", "a", "<tt", ">", "Reader<", "/", "tt", ">", "input", "writing", "results", "to", "a", "<tt", ">", "Wr...
train
https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/properties/PropertiesEscape.java#L1445-L1454
skyscreamer/JSONassert
src/main/java/org/skyscreamer/jsonassert/JSONCompare.java
JSONCompare.compareJSON
public static JSONCompareResult compareJSON(String expectedStr, String actualStr, JSONCompareMode mode) throws JSONException { """ Compares JSON string provided to the expected JSON string, and returns the results of the comparison. @param expectedStr Expected JSON string @param actualStr JSON st...
java
public static JSONCompareResult compareJSON(String expectedStr, String actualStr, JSONCompareMode mode) throws JSONException { return compareJSON(expectedStr, actualStr, getComparatorForMode(mode)); }
[ "public", "static", "JSONCompareResult", "compareJSON", "(", "String", "expectedStr", ",", "String", "actualStr", ",", "JSONCompareMode", "mode", ")", "throws", "JSONException", "{", "return", "compareJSON", "(", "expectedStr", ",", "actualStr", ",", "getComparatorFor...
Compares JSON string provided to the expected JSON string, and returns the results of the comparison. @param expectedStr Expected JSON string @param actualStr JSON string to compare @param mode Defines comparison behavior @return result of the comparison @throws JSONException JSON parsing error
[ "Compares", "JSON", "string", "provided", "to", "the", "expected", "JSON", "string", "and", "returns", "the", "results", "of", "the", "comparison", "." ]
train
https://github.com/skyscreamer/JSONassert/blob/830efcf546d07f955d8a213cc5c8a1db34d78f04/src/main/java/org/skyscreamer/jsonassert/JSONCompare.java#L123-L126
Azure/azure-sdk-for-java
sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/RecommendedElasticPoolsInner.java
RecommendedElasticPoolsInner.listMetricsAsync
public Observable<List<RecommendedElasticPoolMetricInner>> listMetricsAsync(String resourceGroupName, String serverName, String recommendedElasticPoolName) { """ Returns recommented elastic pool metrics. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this valu...
java
public Observable<List<RecommendedElasticPoolMetricInner>> listMetricsAsync(String resourceGroupName, String serverName, String recommendedElasticPoolName) { return listMetricsWithServiceResponseAsync(resourceGroupName, serverName, recommendedElasticPoolName).map(new Func1<ServiceResponse<List<RecommendedElasti...
[ "public", "Observable", "<", "List", "<", "RecommendedElasticPoolMetricInner", ">", ">", "listMetricsAsync", "(", "String", "resourceGroupName", ",", "String", "serverName", ",", "String", "recommendedElasticPoolName", ")", "{", "return", "listMetricsWithServiceResponseAsyn...
Returns recommented elastic pool metrics. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param serverName The name of the server. @param recommendedElasticPoolName The name of the recommended elastic pool...
[ "Returns", "recommented", "elastic", "pool", "metrics", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/RecommendedElasticPoolsInner.java#L291-L298
PuyallupFoursquare/ccb-api-client-java
src/main/java/com/p4square/ccbapi/serializer/FormBuilder.java
FormBuilder.appendField
public void appendField(final String key, final String value) { """ Append a field to the form. @param key The form key, which must be URLEncoded before calling this method. @param value The value associated with the key. The value will be URLEncoded by this method. """ if (builder.length() > 0) { ...
java
public void appendField(final String key, final String value) { if (builder.length() > 0) { builder.append("&"); } try { builder.append(key).append("=").append(URLEncoder.encode(value, "UTF-8")); } catch (UnsupportedEncodingException e) { throw new As...
[ "public", "void", "appendField", "(", "final", "String", "key", ",", "final", "String", "value", ")", "{", "if", "(", "builder", ".", "length", "(", ")", ">", "0", ")", "{", "builder", ".", "append", "(", "\"&\"", ")", ";", "}", "try", "{", "builde...
Append a field to the form. @param key The form key, which must be URLEncoded before calling this method. @param value The value associated with the key. The value will be URLEncoded by this method.
[ "Append", "a", "field", "to", "the", "form", "." ]
train
https://github.com/PuyallupFoursquare/ccb-api-client-java/blob/54a7a3184dc565fe513aa520e1344b2303ea6834/src/main/java/com/p4square/ccbapi/serializer/FormBuilder.java#L61-L71
padrig64/ValidationFramework
validationframework-core/src/main/java/com/google/code/validationframework/base/property/AbstractReadableListProperty.java
AbstractReadableListProperty.doNotifyListenersOfChangedValues
protected void doNotifyListenersOfChangedValues(int startIndex, List<R> oldItems, List<R> newItems) { """ Notifies the change listeners that items have been replaced. <p> Note that the specified lists of items will be wrapped in unmodifiable lists before being passed to the listeners. @param startIndex Index...
java
protected void doNotifyListenersOfChangedValues(int startIndex, List<R> oldItems, List<R> newItems) { List<ListValueChangeListener<R>> listenersCopy = new ArrayList<ListValueChangeListener<R>>(listeners); List<R> oldUnmodifiable = Collections.unmodifiableList(oldItems); List<R> newUnmodifiable =...
[ "protected", "void", "doNotifyListenersOfChangedValues", "(", "int", "startIndex", ",", "List", "<", "R", ">", "oldItems", ",", "List", "<", "R", ">", "newItems", ")", "{", "List", "<", "ListValueChangeListener", "<", "R", ">>", "listenersCopy", "=", "new", ...
Notifies the change listeners that items have been replaced. <p> Note that the specified lists of items will be wrapped in unmodifiable lists before being passed to the listeners. @param startIndex Index of the first replaced item. @param oldItems Previous items. @param newItems New items.
[ "Notifies", "the", "change", "listeners", "that", "items", "have", "been", "replaced", ".", "<p", ">", "Note", "that", "the", "specified", "lists", "of", "items", "will", "be", "wrapped", "in", "unmodifiable", "lists", "before", "being", "passed", "to", "the...
train
https://github.com/padrig64/ValidationFramework/blob/2dd3c7b3403993db366d24a927645f467ccd1dda/validationframework-core/src/main/java/com/google/code/validationframework/base/property/AbstractReadableListProperty.java#L109-L116
OrienteerBAP/wicket-orientdb
wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/converter/AbstractJointConverter.java
AbstractJointConverter.of
public static <F> AbstractJointConverter<F> of(final SerializableFunction<? super F, String> to, final SerializableFunction<String, ? extends F> from) { """ Utility method to construct converter from 2 functions @param <F> type to convert from @param to function to convert ...
java
public static <F> AbstractJointConverter<F> of(final SerializableFunction<? super F, String> to, final SerializableFunction<String, ? extends F> from) { return new AbstractJointConverter<F>() { @Override public String convertToString(F value, Locale locale) { return to...
[ "public", "static", "<", "F", ">", "AbstractJointConverter", "<", "F", ">", "of", "(", "final", "SerializableFunction", "<", "?", "super", "F", ",", "String", ">", "to", ",", "final", "SerializableFunction", "<", "String", ",", "?", "extends", "F", ">", ...
Utility method to construct converter from 2 functions @param <F> type to convert from @param to function to convert to String @param from function to convert from String @return converter
[ "Utility", "method", "to", "construct", "converter", "from", "2", "functions" ]
train
https://github.com/OrienteerBAP/wicket-orientdb/blob/eb1d94f00a6bff9e266c5c032baa6043afc1db92/wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/converter/AbstractJointConverter.java#L47-L60
jwtk/jjwt
api/src/main/java/io/jsonwebtoken/lang/Collections.java
Collections.findValueOfType
public static Object findValueOfType(Collection<?> collection, Class<?>[] types) { """ Find a single value of one of the given types in the given Collection: searching the Collection for a value of the first type, then searching for a value of the second type, etc. @param collection the collection to search @p...
java
public static Object findValueOfType(Collection<?> collection, Class<?>[] types) { if (isEmpty(collection) || Objects.isEmpty(types)) { return null; } for (Class<?> type : types) { Object value = findValueOfType(collection, type); if (value != null) { ...
[ "public", "static", "Object", "findValueOfType", "(", "Collection", "<", "?", ">", "collection", ",", "Class", "<", "?", ">", "[", "]", "types", ")", "{", "if", "(", "isEmpty", "(", "collection", ")", "||", "Objects", ".", "isEmpty", "(", "types", ")",...
Find a single value of one of the given types in the given Collection: searching the Collection for a value of the first type, then searching for a value of the second type, etc. @param collection the collection to search @param types the types to look for, in prioritized order @return a value of one of the given types...
[ "Find", "a", "single", "value", "of", "one", "of", "the", "given", "types", "in", "the", "given", "Collection", ":", "searching", "the", "Collection", "for", "a", "value", "of", "the", "first", "type", "then", "searching", "for", "a", "value", "of", "the...
train
https://github.com/jwtk/jjwt/blob/86b6096946752cffcfbc9b0a5503f1ea195cc140/api/src/main/java/io/jsonwebtoken/lang/Collections.java#L258-L269
chhh/MSFTBX
MSFileToolbox/src/main/java/umich/ms/util/jaxb/JaxbUtils.java
JaxbUtils.unmarshal
public static <T> T unmarshal(Class<T> cl, File f) throws JAXBException { """ Convert the contents of a file to an object of a given class. @param cl Type of object @param f File to be read @return Object of the given type """ return unmarshal(cl, new StreamSource(f)); }
java
public static <T> T unmarshal(Class<T> cl, File f) throws JAXBException { return unmarshal(cl, new StreamSource(f)); }
[ "public", "static", "<", "T", ">", "T", "unmarshal", "(", "Class", "<", "T", ">", "cl", ",", "File", "f", ")", "throws", "JAXBException", "{", "return", "unmarshal", "(", "cl", ",", "new", "StreamSource", "(", "f", ")", ")", ";", "}" ]
Convert the contents of a file to an object of a given class. @param cl Type of object @param f File to be read @return Object of the given type
[ "Convert", "the", "contents", "of", "a", "file", "to", "an", "object", "of", "a", "given", "class", "." ]
train
https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/util/jaxb/JaxbUtils.java#L253-L255
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java
LinearEquationSystem.totalPivotSearch
private IntIntPair totalPivotSearch(int k) { """ Method for total pivot search, searches for x,y in {k,...n}, so that {@code |a_xy| > |a_ij|} @param k search starts at entry (k,k) @return the position of the found pivot element """ double max = 0; int i, j, pivotRow = k, pivotCol = k; double a...
java
private IntIntPair totalPivotSearch(int k) { double max = 0; int i, j, pivotRow = k, pivotCol = k; double absValue; for(i = k; i < coeff.length; i++) { for(j = k; j < coeff[0].length; j++) { // compute absolute value of // current entry in absValue absValue = Math.abs(coeff...
[ "private", "IntIntPair", "totalPivotSearch", "(", "int", "k", ")", "{", "double", "max", "=", "0", ";", "int", "i", ",", "j", ",", "pivotRow", "=", "k", ",", "pivotCol", "=", "k", ";", "double", "absValue", ";", "for", "(", "i", "=", "k", ";", "i...
Method for total pivot search, searches for x,y in {k,...n}, so that {@code |a_xy| > |a_ij|} @param k search starts at entry (k,k) @return the position of the found pivot element
[ "Method", "for", "total", "pivot", "search", "searches", "for", "x", "y", "in", "{", "k", "...", "n", "}", "so", "that", "{", "@code", "|a_xy|", ">", "|a_ij|", "}" ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java#L472-L493
opendatatrentino/s-match
src/main/java/it/unitn/disi/common/utils/ClassFactory.java
ClassFactory.stringToClassInstances
public static List<Object> stringToClassInstances(String str, String separator, Class[] attrTypes, Object[] attrValues) throws DISIException { """ Parses a string of class names separated by separator into a list of objects. @param str names of class...
java
public static List<Object> stringToClassInstances(String str, String separator, Class[] attrTypes, Object[] attrValues) throws DISIException { ArrayList<Object> tmp = new ArrayList<Object>(); StringTokenizer stringTokenizer = new StringTokenizer(s...
[ "public", "static", "List", "<", "Object", ">", "stringToClassInstances", "(", "String", "str", ",", "String", "separator", ",", "Class", "[", "]", "attrTypes", ",", "Object", "[", "]", "attrValues", ")", "throws", "DISIException", "{", "ArrayList", "<", "Ob...
Parses a string of class names separated by separator into a list of objects. @param str names of classes @param separator separator characters @param attrTypes attrTypes @param attrValues attrValues @return ArrayList of class instances @throws DISIException DISIException
[ "Parses", "a", "string", "of", "class", "names", "separated", "by", "separator", "into", "a", "list", "of", "objects", "." ]
train
https://github.com/opendatatrentino/s-match/blob/ba5982ef406b7010c2f92592e43887a485935aa1/src/main/java/it/unitn/disi/common/utils/ClassFactory.java#L129-L140
dita-ot/dita-ot
src/main/java/org/dita/dost/util/FileUtils.java
FileUtils.getRelativePath
public static File getRelativePath(final File basePath, final File refPath) { """ Resolves a path reference against a base path. @param basePath base path @param refPath reference path @return relative path, or refPath if different root means no relative path is possible """ if (!basePath.toPath()...
java
public static File getRelativePath(final File basePath, final File refPath) { if (!basePath.toPath().getRoot().equals(refPath.toPath().getRoot())) { return refPath; } return basePath.toPath().getParent().relativize(refPath.toPath()).toFile(); }
[ "public", "static", "File", "getRelativePath", "(", "final", "File", "basePath", ",", "final", "File", "refPath", ")", "{", "if", "(", "!", "basePath", ".", "toPath", "(", ")", ".", "getRoot", "(", ")", ".", "equals", "(", "refPath", ".", "toPath", "("...
Resolves a path reference against a base path. @param basePath base path @param refPath reference path @return relative path, or refPath if different root means no relative path is possible
[ "Resolves", "a", "path", "reference", "against", "a", "base", "path", "." ]
train
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/FileUtils.java#L168-L173
osglworks/java-tool
src/main/java/org/osgl/Lang.java
F1.compose
public <X1, X2, X3, X4> F4<X1, X2, X3, X4, R> compose(final Func4<? super X1, ? super X2, ? super X3, ? super X4, ? extends P1> before) { """ Returns an {@code F3&lt;X1, X2, X3, X4, R&gt;>} function by composing the specified {@code Func3&ltX1, X2, X3, X4, P1&gt;} function with this function applied last ...
java
public <X1, X2, X3, X4> F4<X1, X2, X3, X4, R> compose(final Func4<? super X1, ? super X2, ? super X3, ? super X4, ? extends P1> before) { final F1<P1, R> me = this; return new F4<X1, X2, X3, X4, R>() { @Override public R apply(X1 x1, X2 x2, X3 x3, X4 x4) {...
[ "public", "<", "X1", ",", "X2", ",", "X3", ",", "X4", ">", "F4", "<", "X1", ",", "X2", ",", "X3", ",", "X4", ",", "R", ">", "compose", "(", "final", "Func4", "<", "?", "super", "X1", ",", "?", "super", "X2", ",", "?", "super", "X3", ",", ...
Returns an {@code F3&lt;X1, X2, X3, X4, R&gt;>} function by composing the specified {@code Func3&ltX1, X2, X3, X4, P1&gt;} function with this function applied last @param <X1> the type of first param the new function applied to @param <X2> the type of second param the new function applied to @param <X3> the type of th...
[ "Returns", "an", "{", "@code", "F3&lt", ";", "X1", "X2", "X3", "X4", "R&gt", ";", ">", "}", "function", "by", "composing", "the", "specified", "{", "@code", "Func3&ltX1", "X2", "X3", "X4", "P1&gt", ";", "}", "function", "with", "this", "function", "app...
train
https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/Lang.java#L728-L737
casbin/jcasbin
src/main/java/org/casbin/jcasbin/util/BuiltInFunctions.java
BuiltInFunctions.ipMatch
public static boolean ipMatch(String ip1, String ip2) { """ ipMatch determines whether IP address ip1 matches the pattern of IP address ip2, ip2 can be an IP address or a CIDR pattern. For example, "192.168.2.123" matches "192.168.2.0/24" @param ip1 the first argument. @param ip2 the second argument. @return...
java
public static boolean ipMatch(String ip1, String ip2) { IPAddressString ipas1 = new IPAddressString(ip1); try { ipas1.validateIPv4(); } catch (AddressStringException e) { e.printStackTrace(); throw new Error("invalid argument: ip1 in IPMatch() function is not ...
[ "public", "static", "boolean", "ipMatch", "(", "String", "ip1", ",", "String", "ip2", ")", "{", "IPAddressString", "ipas1", "=", "new", "IPAddressString", "(", "ip1", ")", ";", "try", "{", "ipas1", ".", "validateIPv4", "(", ")", ";", "}", "catch", "(", ...
ipMatch determines whether IP address ip1 matches the pattern of IP address ip2, ip2 can be an IP address or a CIDR pattern. For example, "192.168.2.123" matches "192.168.2.0/24" @param ip1 the first argument. @param ip2 the second argument. @return whether ip1 matches ip2.
[ "ipMatch", "determines", "whether", "IP", "address", "ip1", "matches", "the", "pattern", "of", "IP", "address", "ip2", "ip2", "can", "be", "an", "IP", "address", "or", "a", "CIDR", "pattern", ".", "For", "example", "192", ".", "168", ".", "2", ".", "12...
train
https://github.com/casbin/jcasbin/blob/b46d7a756b6c39cdb17e0600607e5fcdc66edd11/src/main/java/org/casbin/jcasbin/util/BuiltInFunctions.java#L116-L150
javalite/activejdbc
javalite-common/src/main/java/org/javalite/common/Convert.java
Convert.toInteger
public static Integer toInteger(Object value) { """ Converts value to Integer if it can. If value is a Integer, it is returned, if it is a Number, it is promoted to Integer and then returned, in all other cases, it converts the value to String, then tries to parse Integer from it. @param value value to be con...
java
public static Integer toInteger(Object value) { if (value == null) { return null; } else if (value instanceof Integer) { return (Integer) value; } else if (value instanceof Number) { return ((Number) value).intValue(); } else { try { ...
[ "public", "static", "Integer", "toInteger", "(", "Object", "value", ")", "{", "if", "(", "value", "==", "null", ")", "{", "return", "null", ";", "}", "else", "if", "(", "value", "instanceof", "Integer", ")", "{", "return", "(", "Integer", ")", "value",...
Converts value to Integer if it can. If value is a Integer, it is returned, if it is a Number, it is promoted to Integer and then returned, in all other cases, it converts the value to String, then tries to parse Integer from it. @param value value to be converted to Integer. @return value converted to Integer.
[ "Converts", "value", "to", "Integer", "if", "it", "can", ".", "If", "value", "is", "a", "Integer", "it", "is", "returned", "if", "it", "is", "a", "Number", "it", "is", "promoted", "to", "Integer", "and", "then", "returned", "in", "all", "other", "cases...
train
https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/javalite-common/src/main/java/org/javalite/common/Convert.java#L373-L387
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCClobClient.java
JDBCClobClient.setString
public synchronized int setString(long pos, String str) throws SQLException { """ Writes the given Java <code>String</code> to the <code>CLOB</code> value that this <code>Clob</code> object designates at the position <code>pos</code>. @param pos the position at which to s...
java
public synchronized int setString(long pos, String str) throws SQLException { return setString(pos, str, 0, str.length()); }
[ "public", "synchronized", "int", "setString", "(", "long", "pos", ",", "String", "str", ")", "throws", "SQLException", "{", "return", "setString", "(", "pos", ",", "str", ",", "0", ",", "str", ".", "length", "(", ")", ")", ";", "}" ]
Writes the given Java <code>String</code> to the <code>CLOB</code> value that this <code>Clob</code> object designates at the position <code>pos</code>. @param pos the position at which to start writing to the <code>CLOB</code> value that this <code>Clob</code> object represents @param str the string to be written to ...
[ "Writes", "the", "given", "Java", "<code", ">", "String<", "/", "code", ">", "to", "the", "<code", ">", "CLOB<", "/", "code", ">", "value", "that", "this", "<code", ">", "Clob<", "/", "code", ">", "object", "designates", "at", "the", "position", "<code...
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCClobClient.java#L210-L213
aoindustries/aocode-public
src/main/java/com/aoindustries/net/UrlUtils.java
UrlUtils.decodeUrlPath
public static String decodeUrlPath(String href, String encoding) throws UnsupportedEncodingException { """ Decodes the URL up to the first ?, if present. Does not decode any characters in the set { '?', ':', '/', ';', '#', '+' }. Does not decode tel: urls (case-sensitive). @see #encodeUrlPath(java.lang.St...
java
public static String decodeUrlPath(String href, String encoding) throws UnsupportedEncodingException { if(href.startsWith("tel:")) return href; int len = href.length(); int pos = 0; StringBuilder SB = new StringBuilder(href.length()*2); // Leave a little room for encoding while(pos<len) { int nextPos = Str...
[ "public", "static", "String", "decodeUrlPath", "(", "String", "href", ",", "String", "encoding", ")", "throws", "UnsupportedEncodingException", "{", "if", "(", "href", ".", "startsWith", "(", "\"tel:\"", ")", ")", "return", "href", ";", "int", "len", "=", "h...
Decodes the URL up to the first ?, if present. Does not decode any characters in the set { '?', ':', '/', ';', '#', '+' }. Does not decode tel: urls (case-sensitive). @see #encodeUrlPath(java.lang.String)
[ "Decodes", "the", "URL", "up", "to", "the", "first", "?", "if", "present", ".", "Does", "not", "decode", "any", "characters", "in", "the", "set", "{", "?", ":", "/", ";", "#", "+", "}", "." ]
train
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/net/UrlUtils.java#L105-L129
OrienteerBAP/wicket-orientdb
wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/model/OQueryDataProvider.java
OQueryDataProvider.setSort
public void setSort(String property, Boolean order) { """ Set sort @param property property to sort on @param order order to apply: true is for ascending, false is for descending """ SortOrder sortOrder = order==null?SortOrder.ASCENDING:(order?SortOrder.ASCENDING:SortOrder.DESCENDING); if(property=...
java
public void setSort(String property, Boolean order) { SortOrder sortOrder = order==null?SortOrder.ASCENDING:(order?SortOrder.ASCENDING:SortOrder.DESCENDING); if(property==null) { if(order==null) setSort(null); else setSort("@rid", sortOrder); } else { super.setSort(property, sortOrder);...
[ "public", "void", "setSort", "(", "String", "property", ",", "Boolean", "order", ")", "{", "SortOrder", "sortOrder", "=", "order", "==", "null", "?", "SortOrder", ".", "ASCENDING", ":", "(", "order", "?", "SortOrder", ".", "ASCENDING", ":", "SortOrder", "....
Set sort @param property property to sort on @param order order to apply: true is for ascending, false is for descending
[ "Set", "sort" ]
train
https://github.com/OrienteerBAP/wicket-orientdb/blob/eb1d94f00a6bff9e266c5c032baa6043afc1db92/wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/model/OQueryDataProvider.java#L107-L115
eclipse/xtext-extras
org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/override/RawResolvedFeatures.java
RawResolvedFeatures.getResolvedFeatures
static RawResolvedFeatures getResolvedFeatures(JvmDeclaredType type, CommonTypeComputationServices services) { """ Returns an existing instance of {@link RawResolvedFeatures} or creates a new one that will be cached on the type. It will not add itself as {@link EContentAdapter} but use the {@link JvmTypeChangeDi...
java
static RawResolvedFeatures getResolvedFeatures(JvmDeclaredType type, CommonTypeComputationServices services) { final List<Adapter> adapterList = type.eAdapters(); RawResolvedFeatures adapter = (RawResolvedFeatures) EcoreUtil.getAdapter(adapterList, RawResolvedFeatures.class); if (adapter != null) { return adap...
[ "static", "RawResolvedFeatures", "getResolvedFeatures", "(", "JvmDeclaredType", "type", ",", "CommonTypeComputationServices", "services", ")", "{", "final", "List", "<", "Adapter", ">", "adapterList", "=", "type", ".", "eAdapters", "(", ")", ";", "RawResolvedFeatures"...
Returns an existing instance of {@link RawResolvedFeatures} or creates a new one that will be cached on the type. It will not add itself as {@link EContentAdapter} but use the {@link JvmTypeChangeDispatcher} instead.
[ "Returns", "an", "existing", "instance", "of", "{" ]
train
https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/override/RawResolvedFeatures.java#L63-L79
UrielCh/ovh-java-sdk
ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java
ApiOvhMe.task_contactChange_GET
public ArrayList<Long> task_contactChange_GET(String askingAccount, net.minidev.ovh.api.nichandle.changecontact.OvhTaskStateEnum state, String toAccount) throws IOException { """ List of service contact change tasks you are involved in REST: GET /me/task/contactChange @param toAccount [required] Filter the val...
java
public ArrayList<Long> task_contactChange_GET(String askingAccount, net.minidev.ovh.api.nichandle.changecontact.OvhTaskStateEnum state, String toAccount) throws IOException { String qPath = "/me/task/contactChange"; StringBuilder sb = path(qPath); query(sb, "askingAccount", askingAccount); query(sb, "state", st...
[ "public", "ArrayList", "<", "Long", ">", "task_contactChange_GET", "(", "String", "askingAccount", ",", "net", ".", "minidev", ".", "ovh", ".", "api", ".", "nichandle", ".", "changecontact", ".", "OvhTaskStateEnum", "state", ",", "String", "toAccount", ")", "t...
List of service contact change tasks you are involved in REST: GET /me/task/contactChange @param toAccount [required] Filter the value of toAccount property (like) @param state [required] Filter the value of state property (like) @param askingAccount [required] Filter the value of askingAccount property (like)
[ "List", "of", "service", "contact", "change", "tasks", "you", "are", "involved", "in" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L2460-L2468
phax/ph-oton
ph-oton-security/src/main/java/com/helger/photon/security/role/RoleManager.java
RoleManager.renameRole
@Nonnull public EChange renameRole (@Nullable final String sRoleID, @Nonnull @Nonempty final String sNewName) { """ Rename the role with the passed ID @param sRoleID The ID of the role to be renamed. May be <code>null</code>. @param sNewName The new name of the role. May neither be <code>null</code> nor e...
java
@Nonnull public EChange renameRole (@Nullable final String sRoleID, @Nonnull @Nonempty final String sNewName) { // Resolve user group final Role aRole = getOfID (sRoleID); if (aRole == null) { AuditHelper.onAuditModifyFailure (Role.OT, sRoleID, "no-such-id"); return EChange.UNCHANGED; ...
[ "@", "Nonnull", "public", "EChange", "renameRole", "(", "@", "Nullable", "final", "String", "sRoleID", ",", "@", "Nonnull", "@", "Nonempty", "final", "String", "sNewName", ")", "{", "// Resolve user group", "final", "Role", "aRole", "=", "getOfID", "(", "sRole...
Rename the role with the passed ID @param sRoleID The ID of the role to be renamed. May be <code>null</code>. @param sNewName The new name of the role. May neither be <code>null</code> nor empty. @return {@link EChange#CHANGED} if the passed role ID was found, and the new name is different from the old name of he role
[ "Rename", "the", "role", "with", "the", "passed", "ID" ]
train
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-security/src/main/java/com/helger/photon/security/role/RoleManager.java#L197-L227
Whiley/WhileyCompiler
src/main/java/wyc/io/WhileyFileParser.java
WhileyFileParser.addFieldAliases
private void addFieldAliases(Decl.Variable p, EnclosingScope scope) { """ In the special case of a record type declaration, those fields contained in the record are registered as "field aliases". This means they can be referred to directly from the type invariant, rather than requiring an additional variable be...
java
private void addFieldAliases(Decl.Variable p, EnclosingScope scope) { Type t = p.getType(); if (t instanceof Type.Record) { // This is currently the only situation in which field aliases can // arise. Type.Record r = (Type.Record) t; for (Type.Field fd : r.getFields()) { scope.declareFieldAlias(fd.g...
[ "private", "void", "addFieldAliases", "(", "Decl", ".", "Variable", "p", ",", "EnclosingScope", "scope", ")", "{", "Type", "t", "=", "p", ".", "getType", "(", ")", ";", "if", "(", "t", "instanceof", "Type", ".", "Record", ")", "{", "// This is currently ...
In the special case of a record type declaration, those fields contained in the record are registered as "field aliases". This means they can be referred to directly from the type invariant, rather than requiring an additional variable be declared. For example, the following is permitted: <pre> type Point is {int x, i...
[ "In", "the", "special", "case", "of", "a", "record", "type", "declaration", "those", "fields", "contained", "in", "the", "record", "are", "registered", "as", "field", "aliases", ".", "This", "means", "they", "can", "be", "referred", "to", "directly", "from",...
train
https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L510-L520
cycorp/api-suite
core-api/src/main/java/com/cyc/kb/exception/KbTypeException.java
KbTypeException.fromThrowable
public static KbTypeException fromThrowable(String message, Throwable cause) { """ Converts a Throwable to a KbTypeException with the specified detail message. If the Throwable is a KbTypeException and if the Throwable's message is identical to the one supplied, the Throwable will be passed through unmodified; o...
java
public static KbTypeException fromThrowable(String message, Throwable cause) { return (cause instanceof KbTypeException && Objects.equals(message, cause.getMessage())) ? (KbTypeException) cause : new KbTypeException(message, cause); }
[ "public", "static", "KbTypeException", "fromThrowable", "(", "String", "message", ",", "Throwable", "cause", ")", "{", "return", "(", "cause", "instanceof", "KbTypeException", "&&", "Objects", ".", "equals", "(", "message", ",", "cause", ".", "getMessage", "(", ...
Converts a Throwable to a KbTypeException with the specified detail message. If the Throwable is a KbTypeException and if the Throwable's message is identical to the one supplied, the Throwable will be passed through unmodified; otherwise, it will be wrapped in a new KbTypeException with the detail message. @param cau...
[ "Converts", "a", "Throwable", "to", "a", "KbTypeException", "with", "the", "specified", "detail", "message", ".", "If", "the", "Throwable", "is", "a", "KbTypeException", "and", "if", "the", "Throwable", "s", "message", "is", "identical", "to", "the", "one", ...
train
https://github.com/cycorp/api-suite/blob/1d52affabc4635e3715a059e38741712cbdbf2d5/core-api/src/main/java/com/cyc/kb/exception/KbTypeException.java#L63-L67