signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class AddressUtils { /** * Guesses address type of the provided Bluetooth address . There is not any easy way to identify definitively * address type by using Bluetooth address only , hence the following logic is used to the best make a guess . * @ param url device URL * @ return guessed address type */ pu...
if ( url . getDeviceAddress ( ) == null ) { return AddressType . COMPOSITE ; } return guessAddressType ( url . getDeviceAddress ( ) ) ;
public class xen_sf_storagecentervpx_image { /** * Use this API to fetch filtered set of xen _ sf _ storagecentervpx _ image resources . * filter string should be in JSON format . eg : " vm _ state : DOWN , name : [ a - z ] + " */ public static xen_sf_storagecentervpx_image [ ] get_filtered ( nitro_service service , ...
xen_sf_storagecentervpx_image obj = new xen_sf_storagecentervpx_image ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; xen_sf_storagecentervpx_image [ ] response = ( xen_sf_storagecentervpx_image [ ] ) obj . getfiltered ( service , option ) ; return response ;
public class AWSLogsClient { /** * Lists the specified log groups . You can list all your log groups or filter the results by prefix . The results are * ASCII - sorted by log group name . * @ param describeLogGroupsRequest * @ return Result of the DescribeLogGroups operation returned by the service . * @ throws...
request = beforeClientExecution ( request ) ; return executeDescribeLogGroups ( request ) ;
public class HttpServiceImpl { /** * { @ inheritDoc } */ @ Override public String post ( String url , String json ) throws HttpServiceException , TechnicalException { } }
logger . debug ( "HttpService POST on url: {}" , url ) ; Response response ; try { response = getClient ( ) . newCall ( new Request . Builder ( ) . url ( url ) . post ( RequestBody . create ( MediaType . parse ( "application/json" ) , json ) ) . build ( ) ) . execute ( ) ; String jsonResponse = response . body ( ) . st...
public class JNIWriter { /** * Emit a class file for a given class . * @ param c The class from which a class file is generated . */ public FileObject write ( ClassSymbol c ) throws IOException { } }
String className = c . flatName ( ) . toString ( ) ; Location outLocn ; if ( multiModuleMode ) { ModuleSymbol msym = c . owner . kind == MDL ? ( ModuleSymbol ) c . owner : c . packge ( ) . modle ; outLocn = fileManager . getLocationForModule ( StandardLocation . NATIVE_HEADER_OUTPUT , msym . name . toString ( ) ) ; } e...
public class KerasBatchNormalization { /** * Get layer output type . * @ param inputType Array of InputTypes * @ return output type as InputType * @ throws InvalidKerasConfigurationException Invalid Keras config */ public InputType getOutputType ( InputType ... inputType ) throws InvalidKerasConfigurationExceptio...
if ( inputType . length > 1 ) throw new InvalidKerasConfigurationException ( "Keras BatchNorm layer accepts only one input (received " + inputType . length + ")" ) ; return this . getBatchNormalizationLayer ( ) . getOutputType ( - 1 , inputType [ 0 ] ) ;
public class StringUtil { /** * Convert a < code > String < / code > to a < code > BigInteger < / code > ; since 3.2 it * handles hex ( 0x or # ) and octal ( 0 ) notations . * Returns an empty { @ code Optional } if the string is { @ code null } or can ' t be parsed as { @ code BigInteger } . * @ param str a < co...
if ( N . isNullOrEmptyOrBlank ( str ) ) { return Optional . empty ( ) ; } int pos = 0 ; // offset within string int radix = 10 ; boolean negate = false ; // need to negate later ? if ( str . startsWith ( "-" ) ) { negate = true ; pos = 1 ; } if ( str . startsWith ( "0x" , pos ) || str . startsWith ( "0X" , pos ) ) { //...
public class Status { /** * Method to get a Status from the cache . * @ param _ typeName name of the StatusGroup * @ param _ key key of the Status * @ return Status * @ throws CacheReloadException on error */ public static Status find ( final String _typeName , final String _key ) throws CacheReloadException { ...
return Status . get ( _typeName ) . get ( _key ) ;
public class ServiceConnectManager { /** * Start the connection manager so that any pre - connections are established . */ public void start ( ) { } }
IoFutureListener < ConnectFuture > tmpConnectListener ; if ( interval > 0 ) { tmpConnectListener = new IoFutureListener < ConnectFuture > ( ) { @ Override public void operationComplete ( ConnectFuture future ) { heartbeatFilter . setServiceConnected ( future . isConnected ( ) ) ; updateConnectTimes ( future . isConnect...
public class HttpShellJobDriver { /** * Request the evaluators . */ private synchronized void requestEvaluators ( ) { } }
assert this . state == State . INIT ; LOG . log ( Level . INFO , "Schedule on {0} Evaluators." , this . numEvaluators ) ; this . evaluatorRequestor . newRequest ( ) . setMemory ( 128 ) . setNumberOfCores ( 1 ) . setNumber ( this . numEvaluators ) . submit ( ) ; this . state = State . WAIT_EVALUATORS ; this . expectCoun...
public class CommerceNotificationQueueEntryUtil { /** * Returns the first commerce notification queue entry in the ordered set where sentDate & lt ; & # 63 ; . * @ param sentDate the sent date * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the fir...
return getPersistence ( ) . fetchByLtS_First ( sentDate , orderByComparator ) ;
public class PollingMultiFileWatcher { /** * Starts polling the watched files for changes . * @ param files a set of one or more files to watch for changes . * @ param callback the callback to call with the set of files that changed since the last time . */ @ Override public void start ( Set < File > files , Consum...
if ( isStarted ( ) ) { throw new IllegalStateException ( "start() should not be called more than once" ) ; } Set < File > filesCopy = ImmutableSet . copyOf ( files ) ; Preconditions . checkArgument ( filesCopy . size ( ) > 0 , "must specify at least 1 file to watch for changes" ) ; this . callback = requireNonNull ( ca...
public class CareWebShellEx { /** * Register a plugin by specifying a path and a url . * @ param path Format is & lt ; tab name & gt ; \ & lt ; tree node path & gt ; * @ param url Main url of plugin . * @ return Container created for the plugin . * @ throws Exception Unspecified exception . */ public ElementBas...
return register ( path , url , null ) ;
public class OpenSSHPrivateKeyFile { /** * ( non - Javadoc ) * @ see * com . sshtools . publickey . SshPrivateKeyFile # changePassphrase ( java . lang . String * , java . lang . String ) */ public void changePassphrase ( String oldpassphrase , String newpassphrase ) throws IOException , InvalidPassphraseException...
SshKeyPair pair = toKeyPair ( oldpassphrase ) ; formattedkey = encryptKey ( pair , newpassphrase ) ;
public class GedLinkDocumentMongoToGedObjectConverterVisitor { /** * { @ inheritDoc } */ @ Override public final void visit ( final SubmitterLinkDocumentMongo document ) { } }
setGedObject ( new SubmitterLink ( getParent ( ) , "Submitter" , new ObjectId ( document . getString ( ) ) ) ) ;
public class DecomposeHomography { /** * R = W * U ^ T * N = v2 cross u * ( 1 / d ) * T = ( H - R ) * N */ private void createSolution ( DMatrixRMaj W , DMatrixRMaj U , Vector3D_F64 u , DMatrixRMaj H , Se3_F64 se , Vector3D_F64 N ) { } }
CommonOps_DDRM . multTransB ( W , U , se . getR ( ) ) ; GeometryMath_F64 . cross ( v2 , u , N ) ; CommonOps_DDRM . subtract ( H , se . getR ( ) , tempM ) ; GeometryMath_F64 . mult ( tempM , N , se . getT ( ) ) ;
public class Processor { /** * The processor parameters . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setParameters ( java . util . Collection ) } or { @ link # withParameters ( java . util . Collection ) } if you want to * override the existing values ...
if ( this . parameters == null ) { setParameters ( new java . util . ArrayList < ProcessorParameter > ( parameters . length ) ) ; } for ( ProcessorParameter ele : parameters ) { this . parameters . add ( ele ) ; } return this ;
public class CheckChoicesListView { /** * { @ inheritDoc } */ @ Override protected void populateItem ( final ListItem < T > item ) { } }
item . add ( newLabel ( "label" , getChoiceLabel ( item . getModelObject ( ) ) ) ) ; item . add ( newCheck ( "check" , item . getModel ( ) , item . getIndex ( ) ) ) ;
public class SelectBooleanCheckboxRenderer { /** * Renders the optional label . This method is protected in order to allow * third - party frameworks to derive from it . * @ param rw * the response writer * @ param clientId * the id used by the label to reference the input field * @ param selectBooleanCheck...
if ( selectBooleanCheckbox . isRenderLabel ( ) ) { String label = selectBooleanCheckbox . getLabel ( ) ; if ( label != null ) { rw . startElement ( "label" , selectBooleanCheckbox ) ; generateErrorAndRequiredClass ( selectBooleanCheckbox , rw , clientId , selectBooleanCheckbox . getLabelStyleClass ( ) , Responsive . ge...
public class HttpHeaders { /** * Serializes headers to an { @ link LowLevelHttpRequest } . * @ param headers HTTP headers * @ param logbuf log buffer or { @ code null } for none * @ param curlbuf log buffer for logging curl requests or { @ code null } for none * @ param logger logger or { @ code null } for none...
serializeHeaders ( headers , logbuf , curlbuf , logger , lowLevelHttpRequest , null ) ;
public class AdminDictStemmeroverrideAction { private static OptionalEntity < StemmerOverrideItem > getEntity ( final CreateForm form ) { } }
switch ( form . crudMode ) { case CrudMode . CREATE : final StemmerOverrideItem entity = new StemmerOverrideItem ( 0 , StringUtil . EMPTY , StringUtil . EMPTY ) ; return OptionalEntity . of ( entity ) ; case CrudMode . EDIT : if ( form instanceof EditForm ) { return ComponentUtil . getComponent ( StemmerOverrideService...
public class ZMQ { /** * Polling on items with given selector * CAUTION : This could be affected by jdk epoll bug * @ param selector Open and reuse this selector and do not forget to close when it is not used . * @ param items * @ param count * @ param timeout * @ return number of events */ public static in...
Utils . checkArgument ( items != null , "items have to be supplied for polling" ) ; if ( count == 0 ) { if ( timeout <= 0 ) { return 0 ; } LockSupport . parkNanos ( TimeUnit . NANOSECONDS . convert ( timeout , TimeUnit . MILLISECONDS ) ) ; return 0 ; } long now = 0L ; long end = 0L ; HashMap < SelectableChannel , Selec...
public class DescribeScalingPoliciesRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeScalingPoliciesRequest describeScalingPoliciesRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeScalingPoliciesRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeScalingPoliciesRequest . getPolicyNames ( ) , POLICYNAMES_BINDING ) ; protocolMarshaller . marshall ( describeScalingPoliciesRequest . getServiceN...
public class ScheduledInstanceRecurrence { /** * The days . For a monthly schedule , this is one or more days of the month ( 1-31 ) . For a weekly schedule , this is * one or more days of the week ( 1-7 , where 1 is Sunday ) . * @ return The days . For a monthly schedule , this is one or more days of the month ( 1-...
if ( occurrenceDaySet == null ) { occurrenceDaySet = new com . amazonaws . internal . SdkInternalList < Integer > ( ) ; } return occurrenceDaySet ;
public class MemoryCacher { /** * - - - STOP CACHER - - - */ @ Override public void stopped ( ) { } }
// Stop timer if ( timer != null ) { timer . cancel ( false ) ; timer = null ; } // Clear partitions final long stamp = lock . writeLock ( ) ; try { partitions . clear ( ) ; } finally { lock . unlockWrite ( stamp ) ; }
public class ScriptModuleUtils { /** * Find a class in the module that matches the given className * @ param module the script module to search * @ param className the class name in dotted form . * @ return the found class , or null . */ @ Nullable public static Class < ? > findClass ( ScriptModule module , Strin...
Set < Class < ? > > classes = module . getLoadedClasses ( ) ; Class < ? > targetClass = null ; for ( Class < ? > clazz : classes ) { if ( clazz . getName ( ) . equals ( className ) ) { targetClass = clazz ; break ; } } return targetClass ;
public class RuleContainer { /** * Applies all the rules ordered accordingly to the specified { @ code statement } . */ public Statement apply ( FrameworkMethod method , Description description , Object target , Statement statement ) { } }
if ( methodRules . isEmpty ( ) && testRules . isEmpty ( ) ) { return statement ; } Statement result = statement ; for ( RuleEntry ruleEntry : getSortedEntries ( ) ) { if ( ruleEntry . type == RuleEntry . TYPE_TEST_RULE ) { result = ( ( TestRule ) ruleEntry . rule ) . apply ( result , description ) ; } else { result = (...
public class SequentialExecutionQueue { /** * Starts using a new { @ link ExecutorService } to carry out executions . * The older { @ link ExecutorService } will be shut down ( but it ' s still expected to * complete whatever they are doing and scheduled . ) */ public synchronized void setExecutors ( ExecutorServic...
ExecutorService old = this . executors ; this . executors = svc ; // gradually executions will be taken over by a new pool old . shutdown ( ) ;
public class JsonPayload { /** * endregion */ final JSONObject marshallForSending ( ) throws JSONException { } }
JSONObject result ; String container = getJsonContainer ( ) ; if ( container != null ) { result = new JSONObject ( ) ; result . put ( container , jsonObject ) ; } else { result = jsonObject ; } if ( isAuthenticated ( ) ) { result . put ( "token" , getConversationToken ( ) ) ; } if ( hasSessionId ( ) ) { result . put ( ...
public class CmsFlexController { /** * Puts the response in a suspended state . < p > */ public void suspendFlexResponse ( ) { } }
for ( int i = 0 ; i < m_flexResponseList . size ( ) ; i ++ ) { CmsFlexResponse res = m_flexResponseList . get ( i ) ; res . setSuspended ( true ) ; }
public class SubtitleChatOverlay { /** * Configures us for display of chat history or not . */ protected void setHistoryEnabled ( boolean historyEnabled ) { } }
if ( historyEnabled && _historyModel == null ) { _historyModel = _scrollbar . getModel ( ) ; _historyModel . addChangeListener ( this ) ; resetHistoryOffset ( ) ; // out with the subtitles , we ' ll be displaying history clearGlyphs ( _subtitles ) ; // " scroll " down to the latest history entry updateHistBar ( _histor...
public class XmlUtilities { /** * Change the data in this field to base64. * WARNING - This requires 64bit encoding found in javax . mail ! * @ param field The field containing the binary data to encode . * @ return The string encoded using base64. */ public static String encodeFieldData ( BaseField field ) { } }
if ( field . getData ( ) == null ) return DBConstants . BLANK ; ByteArrayOutputStream baOut = new ByteArrayOutputStream ( ) ; DataOutputStream daOut = new DataOutputStream ( baOut ) ; try { field . write ( daOut , false ) ; daOut . flush ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } char [ ] chOut = Bas...
public class HRcli { /** * Note from Thaniga on 11/5 . DME2Client is not expected to be reused . . . need a fresh one * on each transaction , which is expected to cover the Async aspects . * @ return * @ throws APIException * @ throws DME2Exception */ protected EClient < HttpURLConnection > client ( ) throws Ca...
try { if ( uri == null ) { Item item = hman . loc . best ( ) ; if ( item == null ) { throw new CadiException ( "No service available for " + hman . loc . toString ( ) ) ; } uri = hman . loc . get ( item ) ; } return new HClient ( ss , uri , connectionTimeout ) ; } catch ( Exception e ) { throw new CadiException ( e ) ;...
public class ClassUtil { /** * 获得指定类过滤后的Public方法列表 * @ param clazz 查找方法的类 * @ param excludeMethods 不包括的方法 * @ return 过滤后的方法列表 */ public static List < Method > getPublicMethods ( Class < ? > clazz , Method ... excludeMethods ) { } }
return ReflectUtil . getPublicMethods ( clazz , excludeMethods ) ;
import java . util . * ; class ValidateTriplet { /** * The function checks if there exists a triplet that sums to the given value in the array * Args : * array : The input array * size : The size of the input array * total : The total sum we expect * elements : Initial count of elements * Returns : * True...
if ( elements == 3 && total == 0 ) { return true ; } if ( elements == 3 || size == 0 || total < 0 ) { return false ; } return ( validateTriplet ( array , size - 1 , total - array [ size - 1 ] , elements + 1 ) || validateTriplet ( array , size - 1 , total , elements ) ) ;
public class DefaultPojoBindingFactory { private < P > List < Facet > injectFacetBindings ( DefaultPojoBinding < P > binding , Class < P > pojoType ) { } }
List < Facet > keyFacets = new LinkedList < > ( ) ; facetProvider . getFacets ( pojoType ) . stream ( ) . forEach ( facet -> { if ( facet . hasAnnotation ( PartitionKey . class ) || facet . hasAnnotation ( ClusteringColumn . class ) ) { keyFacets . add ( facet ) ; } else { GenericType facetType = facet . getType ( ) ; ...
public class WeightedIntDiGraph { /** * Sets the weight of the edge s - > t to be w if the edge is present , * otherwise , an IndexOutOfBoundsException is thrown */ public void setWeight ( int s , int t , double w ) { } }
DiEdge e = edge ( s , t ) ; assertEdge ( e ) ; weights . put ( e , w ) ;
public class ConnectionTypesInner { /** * Create a connectiontype . * @ param resourceGroupName Name of an Azure Resource group . * @ param automationAccountName The name of the automation account . * @ param connectionTypeName The parameters supplied to the create or update connectiontype operation . * @ param...
return createOrUpdateWithServiceResponseAsync ( resourceGroupName , automationAccountName , connectionTypeName , parameters ) . toBlocking ( ) . single ( ) . body ( ) ;
public class LatentRelationalAnalysis { /** * prints the { @ code Matrix } to standard out . * @ param rows an { @ code int } containing the number of rows in m * @ param cols an { @ code int } containing the number of cols in m * @ param m the { @ code Matrix } to print * @ return void */ public static void pr...
for ( int col_num = 0 ; col_num < cols ; col_num ++ ) { for ( int row_num = 0 ; row_num < rows ; row_num ++ ) { System . out . print ( m . get ( row_num , col_num ) + " " ) ; } System . out . print ( "\n" ) ; } System . out . print ( "\n" ) ;
public class FileBlobStoreImpl { /** * Delete a key from the blob store * @ param key the key to delete * @ throws IOException on any error */ public void deleteKey ( String key ) throws IOException { } }
File keyDir = getKeyDir ( key ) ; LocalFsBlobStoreFile pf = new LocalFsBlobStoreFile ( keyDir , BlobStoreFile . BLOBSTORE_DATA_FILE ) ; pf . delete ( ) ; delete ( keyDir ) ;
public class PersistenceBrokerImpl { /** * Extent aware Delete by Query * @ param query * @ param cld * @ throws PersistenceBrokerException */ private void deleteByQuery ( Query query , ClassDescriptor cld ) throws PersistenceBrokerException { } }
if ( logger . isDebugEnabled ( ) ) { logger . debug ( "deleteByQuery " + cld . getClassNameOfObject ( ) + ", " + query ) ; } if ( query instanceof QueryBySQL ) { String sql = ( ( QueryBySQL ) query ) . getSql ( ) ; this . dbAccess . executeUpdateSQL ( sql , cld ) ; } else { // if query is Identity based transform it to...
public class JSONAssetConverter { /** * Read a list of assets from an input stream * @ param inputStream * The stream to read from * @ return The list of assets * @ throws IOException */ public static List < Asset > readValues ( InputStream inputStream ) throws IOException { } }
return DataModelSerializer . deserializeList ( inputStream , Asset . class ) ;
public class ShanksAgentBayesianReasoningCapability { /** * Add soft - evidence to the Bayesian network to reason with it . * @ param bn * @ param nodeName * @ param softEvidence * @ throws ShanksException */ public static void addSoftEvidence ( ProbabilisticNetwork bn , String nodeName , HashMap < String , Dou...
ProbabilisticNode targetNode = ShanksAgentBayesianReasoningCapability . getNode ( bn , nodeName ) ; boolean found = false ; for ( Node child : targetNode . getChildren ( ) ) { if ( child . getName ( ) . equals ( softEvidenceNodePrefix + nodeName ) ) { if ( child . getStatesSize ( ) == 2 && child . getStateAt ( 0 ) . eq...
public class StorageAccountsInner { /** * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail...
ServiceResponse < Page < SasTokenInformationInner > > response = listSasTokensNextSinglePageAsync ( nextPageLink ) . toBlocking ( ) . single ( ) ; return new PagedList < SasTokenInformationInner > ( response . body ( ) ) { @ Override public Page < SasTokenInformationInner > nextPage ( String nextPageLink ) { return lis...
public class MultiFormatReader { /** * Decode an image using the state set up by calling setHints ( ) previously . Continuous scan * clients will get a < b > large < / b > speed increase by using this instead of decode ( ) . * @ param image The pixel data to decode * @ return The contents of the image * @ throw...
// Make sure to set up the default state so we don ' t crash if ( readers == null ) { setHints ( null ) ; } return decodeInternal ( image ) ;
public class UtilValidate { /** * Returns true if string s is a valid contiguous U . S . Zip code . Must be 5 or 9 digits only . */ public static boolean isContiguousZipCode ( String s ) { } }
boolean retval = false ; if ( isZipCode ( s ) ) { if ( isEmpty ( s ) ) retval = defaultEmptyOK ; else { String normalizedZip = s . substring ( 0 , 5 ) ; int iZip = Integer . parseInt ( normalizedZip ) ; if ( ( iZip >= 96701 && iZip <= 96898 ) || ( iZip >= 99501 && iZip <= 99950 ) ) retval = false ; else retval = true ;...
public class AbstractResourceRegistration { /** * Get all the handlers at a specific address . * @ param address the address * @ param inherited true to include the inherited operations * @ return the handlers */ @ Override public final Map < String , OperationEntry > getOperationDescriptions ( final PathAddress ...
if ( parent != null ) { RootInvocation ri = getRootInvocation ( ) ; return ri . root . getOperationDescriptions ( ri . pathAddress . append ( address ) , inherited ) ; } // else we are the root Map < String , OperationEntry > providers = new TreeMap < String , OperationEntry > ( ) ; getOperationDescriptions ( address ....
public class BeanContextServicesSupport { /** * Revokes a service in this bean context . * The given service provider is unregistered and a < code > BeanContextServiceRevokedEvent < / code > is fired . All registered service listeners and current * service users get notified . * @ param serviceClass * the servi...
if ( serviceClass == null || serviceProvider == null ) { throw new NullPointerException ( ) ; } synchronized ( globalHierarchyLock ) { synchronized ( services ) { BCSSServiceProvider bcssProvider = ( BCSSServiceProvider ) services . get ( serviceClass ) ; if ( bcssProvider == null ) { // non - exist service return ; } ...
public class GSMTImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case AfplibPackage . GSMT__MCPT : setMCPT ( ( Integer ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
public class AnnotationValidatorCache { /** * 为某个类添加所有待验证属性的 < code > AnnotationValidator < / code > 到 < code > CLASS _ 2 _ ANNOTATION _ VALIDATOR _ MAP < / code > 中 * 流程如下 : * < ul > * < li > 1 . 如果 < code > CLASS _ 2 _ ANNOTATION _ VALIDATOR _ MAP < / code > 已缓存了类对应的验证器 , 则直接退出 < / li > * < li > 2 . 寻找类中所有装饰有...
try { if ( CLASS_2_ANNOTATION_VALIDATOR_MAP . contains ( clazz ) ) { return ; } List < AnnotationValidator > annotationValidators = getAllAnnotationValidators ( registry , clazz ) ; if ( CollectionUtil . isEmpty ( annotationValidators ) ) { LOGGER . debug ( String . format ( "Annotation-based validation enabled for %s,...
public class FTPConnection { /** * Aborts all data transfers */ public void abortDataTransfers ( ) { } }
while ( ! dataConnections . isEmpty ( ) ) { Socket socket = dataConnections . poll ( ) ; if ( socket != null ) Utils . closeQuietly ( socket ) ; }
public class HttpResponseException { /** * Returns an exception message string builder to use for the given HTTP response . * @ since 1.7 */ public static StringBuilder computeMessageBuffer ( HttpResponse response ) { } }
StringBuilder builder = new StringBuilder ( ) ; int statusCode = response . getStatusCode ( ) ; if ( statusCode != 0 ) { builder . append ( statusCode ) ; } String statusMessage = response . getStatusMessage ( ) ; if ( statusMessage != null ) { if ( statusCode != 0 ) { builder . append ( ' ' ) ; } builder . append ( st...
public class MgcpCall { /** * Unregisters all connections that belong to an endpoint . * @ param endpointId The identifier of the endpoint that owns the connections . * @ return A set containing all unregistered connection identifiers . Returns an empty set if no connections exist . */ public Set < Integer > remove...
Set < Integer > removed = this . entries . removeAll ( endpointId ) ; if ( ! removed . isEmpty ( ) && log . isDebugEnabled ( ) ) { log . debug ( "Call " + getCallIdHex ( ) + " unregistered connections " + Arrays . toString ( convertToHex ( removed ) ) + " from endpoint " + endpointId ) ; } return removed ;
public class LTieFunctionBuilder { /** * Adds full new case for the argument that are of specific classes ( matched by instanceOf , null is a wildcard ) . */ @ Nonnull public < V1 extends T1 , V2 extends T2 > LTieFunctionBuilder < T1 , T2 > aCase ( Class < V1 > argC1 , Class < V2 > argC3 , LTieFunction < V1 , V2 > func...
PartialCaseWithIntProduct . The pc = partialCaseFactoryMethod ( ( a1 , a2 , a3 ) -> ( argC1 == null || argC1 . isInstance ( a1 ) ) && ( argC3 == null || argC3 . isInstance ( a2 ) ) ) ; pc . evaluate ( function ) ; return self ( ) ;
public class Interval { /** * Returns a new interval based on this interval but with a different start * and end date . * @ param startDateTime the new start date * @ param endDateTime the new end date * @ return a new interval */ public Interval withDates ( LocalDateTime startDateTime , LocalDateTime endDateTi...
requireNonNull ( startDateTime ) ; requireNonNull ( endDateTime ) ; return new Interval ( startDateTime , endDateTime , this . zoneId ) ;
public class WidgetRoutingDispatcher { /** * We ' re sure the request parameter map is a Map < String , String [ ] > */ @ SuppressWarnings ( "unchecked" ) private Object fireEvent ( Request request , PageBook . Page page , Object instance ) throws IOException { } }
final String method = request . method ( ) ; final String pathInfo = request . path ( ) ; return page . doMethod ( method . toLowerCase ( ) , instance , pathInfo , request ) ;
public class Array { /** * Removes an array entry at the specified position . * @ param ar array to be resized * @ param p position * @ param < T > array type * @ return array */ public static < T > T [ ] delete ( final T [ ] ar , final int p ) { } }
final int s = ar . length - 1 ; move ( ar , p + 1 , - 1 , s - p ) ; return Arrays . copyOf ( ar , s ) ;
public class ParameterObjectMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ParameterObject parameterObject , ProtocolMarshaller protocolMarshaller ) { } }
if ( parameterObject == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( parameterObject . getId ( ) , ID_BINDING ) ; protocolMarshaller . marshall ( parameterObject . getAttributes ( ) , ATTRIBUTES_BINDING ) ; } catch ( Exception e ) { throw...
public class SparseVector { /** * Setter method ( should it be renamed to set ? ) * @ param i set symbolTable [ i ] * @ param value */ public void put ( int i , double value ) { } }
if ( i < 0 || i >= N ) throw new IllegalArgumentException ( "Illegal index " + i + " should be > 0 and < " + N ) ; if ( value == 0.0 ) symbolTable . delete ( i ) ; else symbolTable . put ( i , value ) ;
public class ELHelper { /** * Remove the brackets from an EL expression . * @ param expression The expression to remove the brackets from . * @ param mask Set whether to mask the expression and result . Useful for when passwords might * be contained in either the expression or the result . * @ return The EL exp...
final String methodName = "removeBrackets" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , methodName , new Object [ ] { ( expression == null ) ? null : mask ? OBFUSCATED_STRING : expression , mask } ) ; } expression = expression . trim ( ) ; if ( ( expression . startsWi...
public class DescribeEndpointsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeEndpointsRequest describeEndpointsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeEndpointsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class AnnotationValue { /** * Get the value of the { @ code value } member of the annotation . * @ param type The type * @ param < T > The type * @ return The result */ public final < T > Optional < T > getValue ( Class < T > type ) { } }
return getValue ( ConversionContext . of ( type ) ) ;
public class CommerceDiscountPersistenceImpl { /** * Returns the first commerce discount in the ordered set where groupId = & # 63 ; and couponCode = & # 63 ; . * @ param groupId the group ID * @ param couponCode the coupon code * @ param orderByComparator the comparator to order the set by ( optionally < code > ...
List < CommerceDiscount > list = findByG_C ( groupId , couponCode , 0 , 1 , orderByComparator ) ; if ( ! list . isEmpty ( ) ) { return list . get ( 0 ) ; } return null ;
public class RowKey { /** * Calculates and writes an array of one or more salt bytes at the front of * the given row key . * The salt is calculated by taking the Java hash code of the metric and * tag UIDs and returning a modulo based on the number of salt buckets . * The result will always be a positive intege...
if ( Const . SALT_WIDTH ( ) > 0 ) { if ( row_key . length < ( Const . SALT_WIDTH ( ) + TSDB . metrics_width ( ) ) || ( Bytes . memcmp ( row_key , new byte [ Const . SALT_WIDTH ( ) + TSDB . metrics_width ( ) ] , Const . SALT_WIDTH ( ) , TSDB . metrics_width ( ) ) == 0 ) ) { // ^ Don ' t salt the global annotation row , ...
public class DbSqlSession { /** * lock / / / / / */ public void lock ( String statement , Object parameter ) { } }
// do not perform locking if H2 database is used . H2 uses table level locks // by default which may cause deadlocks if the deploy command needs to get a new // Id using the DbIdGenerator while performing a deployment . if ( ! DbSqlSessionFactory . H2 . equals ( dbSqlSessionFactory . getDatabaseType ( ) ) ) { String ma...
public class ThreadBoundOutputStream { /** * Bind the System . err PrintStream to a ThreadBoundOutputStream and return it . If System . err is already bound , * returns the pre - bound ThreadBoundOutputStream . The binding can be removed with { @ link # unbindSystemErr ( ) } . * @ return A ThreadBoundOutputStream b...
if ( null == boundErrPrint ) { origSystemErr = System . err ; final ThreadBoundOutputStream newErr = new ThreadBoundOutputStream ( origSystemErr ) ; boundErrPrint = new ThreadBoundPrintStream ( newErr ) ; System . setErr ( boundErrPrint ) ; return newErr ; } else { return boundErrPrint . getThreadBoundOutputStream ( ) ...
public class ScalableTargetMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ScalableTarget scalableTarget , ProtocolMarshaller protocolMarshaller ) { } }
if ( scalableTarget == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( scalableTarget . getServiceNamespace ( ) , SERVICENAMESPACE_BINDING ) ; protocolMarshaller . marshall ( scalableTarget . getResourceId ( ) , RESOURCEID_BINDING ) ; protoc...
public class HtmlDocletWriter { /** * Get link to the " package - summary . html " page for the package passed . * @ param pkg Package to which link will be generated * @ return a content tree for the link */ protected Content getNavLinkPackage ( PackageElement pkg ) { } }
Content linkContent = getPackageLink ( pkg , contents . packageLabel ) ; Content li = HtmlTree . LI ( linkContent ) ; return li ;
public class AdjustedRangeInputStream { /** * / * ( non - Javadoc ) * @ see java . io . InputStream # close ( ) */ @ Override public void close ( ) throws IOException { } }
// If not already closed , then close the input stream . if ( ! this . closed ) { this . closed = true ; // if the user read to the end of the virtual stream , then drain // the wrapped stream so the HTTP client can keep this connection // alive if possible . // This should not have too much overhead since if we ' ve r...
public class HikariPool { /** * { @ inheritDoc } */ @ Override public void addBagItem ( final int waiting ) { } }
final boolean shouldAdd = waiting - addConnectionQueue . size ( ) >= 0 ; // Yes , > = is intentional . if ( shouldAdd ) { addConnectionExecutor . submit ( poolEntryCreator ) ; }
public class MainActivity { /** * Request permissions . */ private void requestPermission ( String ... permissions ) { } }
AndPermission . with ( this ) . runtime ( ) . permission ( permissions ) . rationale ( new RuntimeRationale ( ) ) . onGranted ( new Action < List < String > > ( ) { @ Override public void onAction ( List < String > permissions ) { toast ( R . string . successfully ) ; } } ) . onDenied ( new Action < List < String > > (...
public class FastTrackUtility { /** * Skip to the next matching short value . * @ param buffer input data array * @ param offset start offset into the input array * @ param value value to match * @ return offset of matching pattern */ public static int skipToNextMatchingShort ( byte [ ] buffer , int offset , in...
int nextOffset = offset ; while ( getShort ( buffer , nextOffset ) != value ) { ++ nextOffset ; } nextOffset += 2 ; return nextOffset ;
public class FJIterate { /** * Iterate over the collection specified in parallel batches . The * ObjectIntProcedure used must be stateless , or use concurrent aware objects if they are to be shared . The * specified minimum fork size and task count are used instead of the default values . * @ param minForkSize On...
PassThruObjectIntProcedureFactory < PT > procedureFactory = new PassThruObjectIntProcedureFactory < > ( procedure ) ; PassThruCombiner < PT > combiner = new PassThruCombiner < > ( ) ; FJIterate . forEachWithIndex ( iterable , procedureFactory , combiner , minForkSize , taskCount ) ;
public class Routes { /** * finds target for a requested route * @ param httpMethod the http method * @ param path the path * @ param acceptType the accept type * @ return the target */ public RouteMatch find ( HttpMethod httpMethod , String path , String acceptType ) { } }
List < RouteEntry > routeEntries = this . findTargetsForRequestedRoute ( httpMethod , path ) ; RouteEntry entry = findTargetWithGivenAcceptType ( routeEntries , acceptType ) ; return entry != null ? new RouteMatch ( entry . target , entry . path , path , acceptType ) : null ;
public class ListJobsRequest { /** * Specifies to return only these tagged resources . * @ param tags * Specifies to return only these tagged resources . * @ return Returns a reference to this object so that method calls can be chained together . */ public ListJobsRequest withTags ( java . util . Map < String , S...
setTags ( tags ) ; return this ;
public class IntuitRetryPolicyHandler { /** * method to validate the retry policies * @ return boolean */ public boolean retryRequest ( IOException exception , int executionCount , HttpContext context ) { } }
LOG . debug ( "In retry request" ) ; if ( exception == null ) { throw new IllegalArgumentException ( "Exception parameter may not be null" ) ; } else if ( context == null ) { throw new IllegalArgumentException ( "HTTP context may not be null" ) ; } if ( executionCount > this . retryCount ) { return checkPolicy ( execut...
public class AbstractManagerFactory { /** * Shutdown the manager factory and the related session and executor service ( if they are created by Achilles ) . * If the Java driver Session object and / or the executor service were provided as bootstrap parameter , Achilles * will < strong > NOT < / strong > shut them d...
LOGGER . info ( "Calling shutdown on ManagerFactory" ) ; if ( ! configContext . isProvidedSession ( ) ) { LOGGER . info ( format ( "Closing built Session object %s" , rte . session ) ) ; rte . session . close ( ) ; } if ( ! configContext . isProvidedExecutorService ( ) ) { LOGGER . info ( format ( "Closing built execut...
public class ExpressionUtils { /** * Parses an ISO8601 formatted time instant from a string value */ public static Instant parseJsonDate ( String value ) { } }
if ( value == null ) { return null ; } return LocalDateTime . parse ( value , JSON_DATETIME_FORMAT ) . atOffset ( ZoneOffset . UTC ) . toInstant ( ) ;
public class RestoresInner { /** * Restores the specified backup data . This is an asynchronous operation . To know the status of this API call , use GetProtectedItemOperationResult API . * @ param vaultName The name of the Recovery Services vault . * @ param resourceGroupName The name of the resource group associa...
triggerWithServiceResponseAsync ( vaultName , resourceGroupName , fabricName , containerName , protectedItemName , recoveryPointId , resourceRestoreRequest ) . toBlocking ( ) . single ( ) . body ( ) ;
public class PendingCheckpointStats { /** * Reports a successfully completed pending checkpoint . * @ param externalPointer Optional external storage path if checkpoint was externalized . * @ return Callback for the { @ link CompletedCheckpoint } instance to notify about disposal . */ CompletedCheckpointStats . Dis...
CompletedCheckpointStats completed = new CompletedCheckpointStats ( checkpointId , triggerTimestamp , props , numberOfSubtasks , new HashMap < > ( taskStats ) , currentNumAcknowledgedSubtasks , currentStateSize , currentAlignmentBuffered , latestAcknowledgedSubtask , externalPointer ) ; trackerCallback . reportComplete...
public class GaussWeight { /** * Get Gaussian weight . stddev is not used , scaled using max . */ @ Override public double getWeight ( double distance , double max , double stddev ) { } }
if ( max <= 0 ) { return 1.0 ; } double relativedistance = distance / max ; // -2.303 is log ( . 1 ) to suit the intended range of 1.0-0.1 return FastMath . exp ( - 2.3025850929940455 * relativedistance * relativedistance ) ;
public class DescribeProductRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeProductRequest describeProductRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeProductRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeProductRequest . getAcceptLanguage ( ) , ACCEPTLANGUAGE_BINDING ) ; protocolMarshaller . marshall ( describeProductRequest . getId ( ) , ID_BINDING ) ; } ...
public class LineManager { /** * Set the LineTranslate property * The geometry ' s offset . Values are [ x , y ] where negatives indicate left and up , respectively . * @ param value property wrapper value around Float [ ] */ public void setLineTranslate ( Float [ ] value ) { } }
PropertyValue propertyValue = lineTranslate ( value ) ; constantPropertyUsageMap . put ( PROPERTY_LINE_TRANSLATE , propertyValue ) ; layer . setProperties ( propertyValue ) ;
public class SPX { /** * / * [ deutsch ] * < p > Implementierungsmethode des Interface { @ link Externalizable } . < / p > * < p > Das erste Byte enth & auml ; lt um 4 Bits nach links verschoben den * Typ des zu serialisierenden Objekts . Danach folgen die Daten - Bits * in einer bit - komprimierten Darstellung...
switch ( this . type ) { case FALLBACK_TIMEZONE_TYPE : this . writeFallback ( out ) ; break ; case TRANSITION_RESOLVER_TYPE : this . writeStrategy ( out ) ; break ; case HISTORIZED_TIMEZONE_TYPE : this . writeZone ( out ) ; break ; case ZONAL_OFFSET_TYPE : this . writeOffset ( out ) ; break ; default : throw new Invali...
public class IfcRepresentationMapImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public EList < IfcShapeAspect > getHasShapeAspects ( ) { } }
return ( EList < IfcShapeAspect > ) eGet ( Ifc4Package . Literals . IFC_REPRESENTATION_MAP__HAS_SHAPE_ASPECTS , true ) ;
public class StreamUtils { /** * Copy all the characters from a reader to a writer . * @ param reader Input character stream * @ param writer Output character stream * @ param transferBufferSize Size of character buffer used to transfer characters from * one stream to the other * @ throws IOException */ stati...
if ( transferBufferSize < 1 ) { throw new IOException ( "Transfer buffer size can not be smaller than 1" ) ; } char [ ] buffer = new char [ transferBufferSize ] ; int bytesRead = reader . read ( buffer ) ; while ( bytesRead >= 0 ) { writer . write ( buffer , 0 , bytesRead ) ; bytesRead = reader . read ( buffer ) ; }
public class CellStyleProxy { /** * 書式を設定する 。 * < p > 設定使用とする書式がない場合は 、 セルの書式を優先する 。 * < br > ただし 、 セルの書式も内場合は 、 デフォルトの書式を設定する 。 * @ param settingPattern 設定しようとする書式 ( 空の場合がある ) * @ param defaultPattern デフォルトの書式 */ public void setDataFormat ( final String settingPattern , final String defaultPattern , final...
String currentPattern = POIUtils . getCellFormatPattern ( cell , cellFormatter ) ; if ( Utils . isNotEmpty ( settingPattern ) ) { // アノテーションで書式が指定されている場合 、 更新する setDataFormat ( settingPattern , cellFormatter ) ; } else if ( currentPattern . isEmpty ( ) || currentPattern . equalsIgnoreCase ( "general" ) ) { // セルの書式が...
public class ReflectionUtils { /** * Invoke the specified { @ link Method } against the supplied target object with the supplied arguments . The target object can * be { @ code null } when invoking a static { @ link Method } . * Thrown exceptions are handled via a call to { @ link # handleReflectionException } . ...
try { return method . invoke ( target , args ) ; } catch ( Exception ex ) { handleReflectionException ( ex ) ; } throw new IllegalStateException ( "Should never get here" ) ;
public class FileSystemContext { /** * Read the contents of the file at the given path and return the associated * byte array . * @ param filePath The path to the file to read * @ return The contents of the file * @ throws IOException if an error occurs reading the file */ public byte [ ] getFileBytes ( String ...
byte [ ] out = null ; String path = ( String ) Utils . intern ( filePath ) ; RandomAccessFile raf = null ; synchronized ( path ) { File file = null ; try { file = new File ( path ) ; boolean exists = file . exists ( ) ; if ( exists ) { byte [ ] fileBytes = new byte [ ( int ) file . length ( ) ] ; raf = new RandomAccess...
public class Geometry { /** * Returns cardinal points for a given bounding box * @ param box the bounding box * @ return [ C , N , NE , E , SE , S , SW , W , NW ] */ public static final Point2DArray getCardinals ( final BoundingBox box , final Direction [ ] requestedCardinals ) { } }
final Set < Direction > set = new HashSet < > ( Arrays . asList ( requestedCardinals ) ) ; final Point2DArray points = new Point2DArray ( ) ; final Point2D c = findCenter ( box ) ; final Point2D n = new Point2D ( c . getX ( ) , box . getY ( ) ) ; final Point2D e = new Point2D ( box . getX ( ) + box . getWidth ( ) , c ....
public class SparkJobContext { /** * Gets the path defined in the job properties file * @ return */ public URI getResultPath ( ) { } }
final String str = _customProperties . get ( PROPERTY_RESULT_PATH ) ; if ( Strings . isNullOrEmpty ( str ) ) { return null ; } return URI . create ( str ) ;
public class ElementParametersImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setElementRef ( String newElementRef ) { } }
String oldElementRef = elementRef ; elementRef = newElementRef ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , BpsimPackage . ELEMENT_PARAMETERS__ELEMENT_REF , oldElementRef , elementRef ) ) ;
public class AbstractUserObject { /** * Method to set the status of a UserObject in the eFaps Database . * @ param _ status status to set * @ throws EFapsException on error */ protected void setStatusInDB ( final boolean _status ) throws EFapsException { } }
Connection con = null ; try { con = Context . getConnection ( ) ; PreparedStatement stmt = null ; final StringBuilder cmd = new StringBuilder ( ) ; try { cmd . append ( " update T_USERABSTRACT set STATUS=? where ID=" ) . append ( getId ( ) ) ; stmt = con . prepareStatement ( cmd . toString ( ) ) ; stmt . setBoolean ( 1...
public class HadoopJob { /** * Returns a string representation of this job status * @ return string representation of this job status */ public String getStatus ( ) { } }
StringBuffer s = new StringBuffer ( ) ; s . append ( "Maps : " + completedMaps + "/" + totalMaps ) ; s . append ( " (" + mapProgress + ")" ) ; s . append ( " Reduces : " + completedReduces + "/" + totalReduces ) ; s . append ( " (" + reduceProgress + ")" ) ; return s . toString ( ) ;
public class ResourceQueryMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ResourceQuery resourceQuery , ProtocolMarshaller protocolMarshaller ) { } }
if ( resourceQuery == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( resourceQuery . getType ( ) , TYPE_BINDING ) ; protocolMarshaller . marshall ( resourceQuery . getQuery ( ) , QUERY_BINDING ) ; } catch ( Exception e ) { throw new SdkClie...
public class PBaseCompareable { /** * Greater or equal to lower value and strictly less than upper value . * This is generally preferable over Between for date and datetime types * as SQL Between is inclusive on the upper bound ( < = ) and generally we * need the upper bound to be exclusive ( < ) . * @ param lo...
expr ( ) . inRange ( _name , lower , upper ) ; return _root ;
public class GuildManager { /** * Sets the name of this { @ link net . dv8tion . jda . core . entities . Guild Guild } . * @ param name * The new name for this { @ link net . dv8tion . jda . core . entities . Guild Guild } * @ throws IllegalArgumentException * If the provided name is { @ code null } or not betw...
Checks . notNull ( name , "Name" ) ; Checks . check ( name . length ( ) >= 2 && name . length ( ) <= 100 , "Name must be between 2-100 characters long" ) ; this . name = name ; set |= NAME ; return this ;
public class AbstractVueComponentFactoryGenerator { /** * Generate our { @ link VueComponentFactory } class . * @ param component The { @ link IsVueComponent } class to generate { @ link VueComponentOptions } from */ public void generate ( TypeElement component ) { } }
ClassName vueFactoryClassName = componentFactoryName ( component ) ; Builder vueFactoryBuilder = createFactoryBuilderClass ( component , vueFactoryClassName ) ; createGetName ( vueFactoryBuilder , component ) ; createProperties ( vueFactoryClassName , vueFactoryBuilder ) ; List < CodeBlock > staticInitParameters = crea...
public class ExecutionEntity { /** * for setting the process definition , this setter must be used as subclasses * can override */ protected void ensureProcessDefinitionInitialized ( ) { } }
if ( ( processDefinition == null ) && ( processDefinitionId != null ) ) { ProcessDefinitionEntity deployedProcessDefinition = Context . getProcessEngineConfiguration ( ) . getDeploymentCache ( ) . findDeployedProcessDefinitionById ( processDefinitionId ) ; setProcessDefinition ( deployedProcessDefinition ) ; }
public class CharacterApi { /** * Get character corporation titles Returns a character & # 39 ; s titles - - - * This route is cached for up to 3600 seconds SSO Scope : * esi - characters . read _ titles . v1 * @ param characterId * An EVE character ID ( required ) * @ param datasource * The server name you...
ApiResponse < List < CharacterTitlesResponse > > resp = getCharactersCharacterIdTitlesWithHttpInfo ( characterId , datasource , ifNoneMatch , token ) ; return resp . getData ( ) ;