signature
stringlengths 43
39.1k
| implementation
stringlengths 0
450k
|
|---|---|
public class Streams { /** * Attempt to transform this Stream to the same type as the supplied Monoid , using supplied function
* Then use Monoid to reduce values
* @ param mapper Function to transform Monad type
* @ param reducer Monoid to reduce values
* @ return Reduce result */
public final static < T , R > R foldMap ( final Stream < T > stream , final Function < ? super T , ? extends R > mapper , final Monoid < R > reducer ) { } }
|
return reducer . foldLeft ( stream . map ( mapper ) ) ;
|
public class StreamImplTee { /** * Reads the next chunk from the stream in non - blocking mode .
* @ param buffer byte array receiving the data .
* @ param offset starting offset into the array .
* @ param length number of bytes to read .
* @ return the number of bytes read , - 1 on end of file , or 0 on timeout . */
@ Override public int readTimeout ( byte [ ] buffer , int offset , int length , long timeout ) throws IOException { } }
|
int sublen = getDelegate ( ) . readTimeout ( buffer , offset , length , timeout ) ; if ( sublen > 0 ) { logStream ( ) . write ( buffer , offset , sublen ) ; } return sublen ;
|
public class LocomotiveConfig { /** * Url that automated tests will be testing .
* @ return If a base url is provided it ' ll return the base url + path , otherwise it ' ll fallback to the normal url params . */
@ Override public String url ( ) { } }
|
String url = "" ; if ( ! StringUtils . isEmpty ( baseUrl ( ) ) ) { url = baseUrl ( ) + path ( ) ; } else { if ( ! StringUtils . isEmpty ( properties . getProperty ( Constants . DEFAULT_PROPERTY_URL ) ) ) { url = properties . getProperty ( Constants . DEFAULT_PROPERTY_URL ) ; } if ( testConfig != null && ( ! StringUtils . isEmpty ( testConfig . url ( ) ) ) ) { url = testConfig . url ( ) ; } if ( ! StringUtils . isEmpty ( JvmUtil . getJvmProperty ( Constants . JVM_CONDUCTOR_URL ) ) ) { url = JvmUtil . getJvmProperty ( Constants . JVM_CONDUCTOR_URL ) ; } } return url ;
|
public class InMemoryLookupTable { /** * Iterate on the given 2 vocab words
* @ param w1 the first word to iterate on
* @ param w2 the second word to iterate on
* @ param nextRandom next random for sampling */
@ Override @ Deprecated public void iterateSample ( T w1 , T w2 , AtomicLong nextRandom , double alpha ) { } }
|
if ( w2 == null || w2 . getIndex ( ) < 0 || w1 . getIndex ( ) == w2 . getIndex ( ) || w1 . getLabel ( ) . equals ( "STOP" ) || w2 . getLabel ( ) . equals ( "STOP" ) || w1 . getLabel ( ) . equals ( "UNK" ) || w2 . getLabel ( ) . equals ( "UNK" ) ) return ; // current word vector
INDArray l1 = this . syn0 . slice ( w2 . getIndex ( ) ) ; // error for current word and context
INDArray neu1e = Nd4j . create ( vectorLength ) ; for ( int i = 0 ; i < w1 . getCodeLength ( ) ; i ++ ) { int code = w1 . getCodes ( ) . get ( i ) ; int point = w1 . getPoints ( ) . get ( i ) ; if ( point >= syn0 . rows ( ) || point < 0 ) throw new IllegalStateException ( "Illegal point " + point ) ; // other word vector
INDArray syn1 = this . syn1 . slice ( point ) ; double dot = Nd4j . getBlasWrapper ( ) . dot ( l1 , syn1 ) ; if ( dot < - MAX_EXP || dot >= MAX_EXP ) continue ; int idx = ( int ) ( ( dot + MAX_EXP ) * ( ( double ) expTable . length / MAX_EXP / 2.0 ) ) ; if ( idx >= expTable . length ) continue ; // score
double f = expTable [ idx ] ; // gradient
double g = useAdaGrad ? w1 . getGradient ( i , ( 1 - code - f ) , lr . get ( ) ) : ( 1 - code - f ) * alpha ; Nd4j . getBlasWrapper ( ) . level1 ( ) . axpy ( syn1 . length ( ) , g , syn1 , neu1e ) ; Nd4j . getBlasWrapper ( ) . level1 ( ) . axpy ( syn1 . length ( ) , g , l1 , syn1 ) ; } int target = w1 . getIndex ( ) ; int label ; // negative sampling
if ( negative > 0 ) for ( int d = 0 ; d < negative + 1 ; d ++ ) { if ( d == 0 ) label = 1 ; else { nextRandom . set ( nextRandom . get ( ) * 25214903917L + 11 ) ; // FIXME : int cast
int idx = ( int ) Math . abs ( ( int ) ( nextRandom . get ( ) >> 16 ) % table . length ( ) ) ; target = table . getInt ( idx ) ; if ( target <= 0 ) target = ( int ) nextRandom . get ( ) % ( vocab . numWords ( ) - 1 ) + 1 ; if ( target == w1 . getIndex ( ) ) continue ; label = 0 ; } if ( target >= syn1Neg . rows ( ) || target < 0 ) continue ; double f = Nd4j . getBlasWrapper ( ) . dot ( l1 , syn1Neg . slice ( target ) ) ; double g ; if ( f > MAX_EXP ) g = useAdaGrad ? w1 . getGradient ( target , ( label - 1 ) , alpha ) : ( label - 1 ) * alpha ; else if ( f < - MAX_EXP ) g = label * ( useAdaGrad ? w1 . getGradient ( target , alpha , alpha ) : alpha ) ; else g = useAdaGrad ? w1 . getGradient ( target , label - expTable [ ( int ) ( ( f + MAX_EXP ) * ( expTable . length / MAX_EXP / 2 ) ) ] , alpha ) : ( label - expTable [ ( int ) ( ( f + MAX_EXP ) * ( expTable . length / MAX_EXP / 2 ) ) ] ) * alpha ; if ( syn0 . data ( ) . dataType ( ) == DataType . DOUBLE ) Nd4j . getBlasWrapper ( ) . axpy ( g , syn1Neg . slice ( target ) , neu1e ) ; else Nd4j . getBlasWrapper ( ) . axpy ( ( float ) g , syn1Neg . slice ( target ) , neu1e ) ; if ( syn0 . data ( ) . dataType ( ) == DataType . DOUBLE ) Nd4j . getBlasWrapper ( ) . axpy ( g , l1 , syn1Neg . slice ( target ) ) ; else Nd4j . getBlasWrapper ( ) . axpy ( ( float ) g , l1 , syn1Neg . slice ( target ) ) ; } if ( syn0 . data ( ) . dataType ( ) == DataType . DOUBLE ) Nd4j . getBlasWrapper ( ) . axpy ( 1.0 , neu1e , l1 ) ; else Nd4j . getBlasWrapper ( ) . axpy ( 1.0f , neu1e , l1 ) ;
|
public class HierarchicalUriComponents { /** * expanding */
@ Override protected HierarchicalUriComponents expandInternal ( UriTemplateVariables uriVariables ) { } }
|
Assert . state ( ! this . encoded , "Cannot expand an already encoded UriComponents object" ) ; String expandedScheme = expandUriComponent ( getScheme ( ) , uriVariables ) ; String expandedUserInfo = expandUriComponent ( this . userInfo , uriVariables ) ; String expandedHost = expandUriComponent ( this . host , uriVariables ) ; String expandedPort = expandUriComponent ( this . port , uriVariables ) ; PathComponent expandedPath = this . path . expand ( uriVariables ) ; MultiValueMap < String , String > expandedQueryParams = new LinkedMultiValueMap < String , String > ( this . queryParams . size ( ) ) ; for ( Map . Entry < String , List < String > > entry : this . queryParams . entrySet ( ) ) { String expandedName = expandUriComponent ( entry . getKey ( ) , uriVariables ) ; List < String > expandedValues = new ArrayList < String > ( entry . getValue ( ) . size ( ) ) ; for ( String value : entry . getValue ( ) ) { String expandedValue = expandUriComponent ( value , uriVariables ) ; expandedValues . add ( expandedValue ) ; } expandedQueryParams . put ( expandedName , expandedValues ) ; } String expandedFragment = expandUriComponent ( this . getFragment ( ) , uriVariables ) ; return new HierarchicalUriComponents ( expandedScheme , expandedUserInfo , expandedHost , expandedPort , expandedPath , expandedQueryParams , expandedFragment , false , false ) ;
|
public class I18NConnector { /** * Returns the value for this label ussing the getThreadLocaleLanguage
* @ param section
* @ param idInSection
* @ return */
public static String getLabel ( Class < ? > clazz , String label ) { } }
|
Language language = getThreadLocalLanguage ( null ) ; if ( language == null ) { return label ; } else { return getLabel ( language , clazz . getName ( ) , label ) ; }
|
public class AppServiceEnvironmentsInner { /** * Get metric definitions for a multi - role pool of an App Service Environment .
* Get metric definitions for a multi - role pool of an App Service Environment .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param name Name of the App Service Environment .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < List < ResourceMetricDefinitionInner > > listMultiRoleMetricDefinitionsAsync ( final String resourceGroupName , final String name , final ListOperationCallback < ResourceMetricDefinitionInner > serviceCallback ) { } }
|
return AzureServiceFuture . fromPageResponse ( listMultiRoleMetricDefinitionsSinglePageAsync ( resourceGroupName , name ) , new Func1 < String , Observable < ServiceResponse < Page < ResourceMetricDefinitionInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < ResourceMetricDefinitionInner > > > call ( String nextPageLink ) { return listMultiRoleMetricDefinitionsNextSinglePageAsync ( nextPageLink ) ; } } , serviceCallback ) ;
|
public class ApiOvhEmailexchange { /** * Get this object properties
* REST : GET / email / exchange / { organizationName } / service / { exchangeService } / externalContact / { externalEmailAddress }
* @ param organizationName [ required ] The internal name of your exchange organization
* @ param exchangeService [ required ] The internal name of your exchange service
* @ param externalEmailAddress [ required ] Contact email */
public OvhExchangeExternalContact organizationName_service_exchangeService_externalContact_externalEmailAddress_GET ( String organizationName , String exchangeService , String externalEmailAddress ) throws IOException { } }
|
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/externalContact/{externalEmailAddress}" ; StringBuilder sb = path ( qPath , organizationName , exchangeService , externalEmailAddress ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhExchangeExternalContact . class ) ;
|
public class CmsHtmlImport { /** * Validates a filename for OpenCms . < p >
* This method checks if there are any illegal characters in the filename and modifies them
* if necessary . In addition it ensures that no duplicate filenames are created . < p >
* @ param filename the filename to validate
* @ return a validated and unique filename in OpenCms */
private String validateFilename ( String filename ) { } }
|
// if its an external filename , use it directly
if ( isExternal ( filename ) ) { return filename ; } // check if this resource name does already exist
// if so add a postfix to the name
int postfix = 1 ; boolean found = true ; String validFilename = filename ; // if we are not in overwrite mode , we must find a valid , non - existing filename
// otherwise we will use the current translated name
if ( ! m_overwrite ) { while ( found ) { try { // get the translated name , this one only contains valid chars in OpenCms
validFilename = m_cmsObject . getRequestContext ( ) . getFileTranslator ( ) . translateResource ( validFilename ) ; // try to read the file . . . . .
found = true ; // first try to read it form the fileIndex of already processed files
if ( ! m_fileIndex . containsValue ( validFilename . replace ( '\\' , '/' ) ) ) { found = false ; } if ( ! found ) { found = true ; // there was no entry in the fileIndex , so try to read from the VFS
m_cmsObject . readResource ( validFilename , CmsResourceFilter . ALL ) ; } // . . . . it ' s there , so add a postfix and try again
String path = filename . substring ( 0 , filename . lastIndexOf ( "/" ) + 1 ) ; String name = filename . substring ( filename . lastIndexOf ( "/" ) + 1 , filename . length ( ) ) ; validFilename = path ; if ( name . lastIndexOf ( "." ) > 0 ) { validFilename += name . substring ( 0 , name . lastIndexOf ( "." ) ) ; } else { validFilename += name ; } validFilename += "_" + postfix ; if ( name . lastIndexOf ( "." ) > 0 ) { validFilename += name . substring ( name . lastIndexOf ( "." ) , name . length ( ) ) ; } postfix ++ ; } catch ( CmsException e ) { // the file does not exist , so we can use this filename
found = false ; } } } else { validFilename = validFilename . replace ( '\\' , '/' ) ; } return OpenCms . getResourceManager ( ) . getFileTranslator ( ) . translateResource ( validFilename ) ;
|
public class ExqlPatternImpl { /** * 进行简单测试 */
public static void main ( String ... args ) throws Exception { } }
|
// 编译下列语句
ExqlPattern pattern = ExqlPatternImpl . compile ( "SELECT #(:expr1.length()), :expr2.class.name," + " ##(:expr3) WHERE #if(:expr4) {e = :expr4} #else {e IS NULL}" + "#for(variant in :expr5.bytes) { AND c = :variant}" // NL
+ " GROUP BY #!(:expr1) ASC {expr3}" ) ; ExqlContext context = new ExqlContextImpl ( ) ; HashMap < String , Object > map = new HashMap < String , Object > ( ) ; map . put ( "expr1" , "expr1" ) ; map . put ( "expr2" , "expr2" ) ; map . put ( "expr3" , "expr3" ) ; map . put ( "expr4" , "expr4" ) ; map . put ( "expr5" , "expr5" ) ; pattern . execute ( context , map ) ; System . out . println ( context . flushOut ( ) ) ; System . out . println ( Arrays . toString ( context . getArgs ( ) ) ) ;
|
public class FactoryDenseOpticalFlow { /** * Compute optical flow using { @ link PyramidKltTracker } .
* @ see DenseOpticalFlowKlt
* @ param configKlt Configuration for KLT . If null then default values are used .
* @ param radius Radius of square region .
* @ param inputType Type of input image .
* @ param derivType Type of derivative image . If null then default is used .
* @ param < I > Input image type .
* @ param < D > Derivative image type .
* @ return DenseOpticalFlow */
public static < I extends ImageGray < I > , D extends ImageGray < D > > DenseOpticalFlow < I > flowKlt ( @ Nullable PkltConfig configKlt , int radius , Class < I > inputType , Class < D > derivType ) { } }
|
if ( configKlt == null ) configKlt = new PkltConfig ( ) ; if ( derivType == null ) { derivType = GImageDerivativeOps . getDerivativeType ( inputType ) ; } int numLayers = configKlt . pyramidScaling . length ; ImageType < I > imagetype = ImageType . single ( inputType ) ; PyramidDiscrete < I > pyramidA = FactoryPyramid . discreteGaussian ( configKlt . pyramidScaling , - 1 , 2 , true , imagetype ) ; PyramidDiscrete < I > pyramidB = FactoryPyramid . discreteGaussian ( configKlt . pyramidScaling , - 1 , 2 , true , imagetype ) ; PyramidKltTracker < I , D > tracker = FactoryTrackerAlg . kltPyramid ( configKlt . config , inputType , derivType ) ; DenseOpticalFlowKlt < I , D > flowKlt = new DenseOpticalFlowKlt < > ( tracker , numLayers , radius ) ; ImageGradient < I , D > gradient = FactoryDerivative . sobel ( inputType , derivType ) ; return new FlowKlt_to_DenseOpticalFlow < > ( flowKlt , gradient , pyramidA , pyramidB , inputType , derivType ) ;
|
public class PDPageContentStreamExt { /** * Draws the given Form XObject at the current location .
* @ param form
* Form XObject
* @ throws IOException
* if the content stream could not be written
* @ throws IllegalStateException
* If the method was called within a text block . */
public void drawForm ( final PDFormXObject form ) throws IOException { } }
|
if ( inTextMode ) { throw new IllegalStateException ( "Error: drawForm is not allowed within a text block." ) ; } writeOperand ( resources . add ( form ) ) ; writeOperator ( ( byte ) 'D' , ( byte ) 'o' ) ;
|
public class Storage { /** * Factory method to create a new storage backed by a hashtable .
* @ param < K >
* @ param < V >
* @ return */
public static < K , V > Storage < K , V > createHashtableStorage ( ) { } }
|
return new Storage < K , V > ( new MapStorageWrapper < K , V > ( new HashMap < K , V > ( ) ) ) ;
|
public class UIContextImpl { /** * Reserved for internal framework use . Sets a framework attribute .
* @ param name the attribute name .
* @ param value the attribute value . */
@ Override public void setFwkAttribute ( final String name , final Object value ) { } }
|
if ( attribMap == null ) { attribMap = new HashMap < > ( ) ; } attribMap . put ( name , value ) ;
|
public class StreamService { /** * { @ inheritDoc } */
public void play ( Boolean dontStop ) { } }
|
log . debug ( "Play without stop: {}" , dontStop ) ; if ( ! dontStop ) { IConnection conn = Red5 . getConnectionLocal ( ) ; if ( conn instanceof IStreamCapableConnection ) { IStreamCapableConnection streamConn = ( IStreamCapableConnection ) conn ; Number streamId = conn . getStreamId ( ) ; IClientStream stream = streamConn . getStreamById ( streamId ) ; if ( stream != null ) { stream . stop ( ) ; } } }
|
public class SymbolOptions { /** * Set the LatLng of the symbol , which represents the location of the symbol on the map
* @ param latLng the location of the symbol in a longitude and latitude pair
* @ return this */
public SymbolOptions withLatLng ( LatLng latLng ) { } }
|
geometry = Point . fromLngLat ( latLng . getLongitude ( ) , latLng . getLatitude ( ) ) ; return this ;
|
public class AmazonPinpointClient { /** * Update an Voice channel
* @ param updateVoiceChannelRequest
* @ return Result of the UpdateVoiceChannel operation returned by the service .
* @ throws BadRequestException
* 400 response
* @ throws InternalServerErrorException
* 500 response
* @ throws ForbiddenException
* 403 response
* @ throws NotFoundException
* 404 response
* @ throws MethodNotAllowedException
* 405 response
* @ throws TooManyRequestsException
* 429 response
* @ sample AmazonPinpoint . UpdateVoiceChannel
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / pinpoint - 2016-12-01 / UpdateVoiceChannel " target = " _ top " > AWS
* API Documentation < / a > */
@ Override public UpdateVoiceChannelResult updateVoiceChannel ( UpdateVoiceChannelRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeUpdateVoiceChannel ( request ) ;
|
public class SSLComponent { /** * TODO bug in bnd requires setting service */
@ Reference ( service = RepertoireConfigService . class , cardinality = ReferenceCardinality . MULTIPLE , policy = ReferencePolicy . DYNAMIC , target = "(id=*)" ) protected synchronized void setRepertoire ( RepertoireConfigService config ) { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Adding repertoire: " + config . getAlias ( ) ) ; } Map < String , Object > properties = config . getProperties ( ) ; repertoireMap . put ( config . getAlias ( ) , config ) ; repertoirePIDMap . put ( config . getPID ( ) , config . getAlias ( ) ) ; repertoirePropertiesMap . put ( config . getAlias ( ) , properties ) ; addKeyStores ( true , config . getKeyStore ( ) , config . getTrustStore ( ) ) ;
|
public class HttpResponseBodyDecoder { /** * Checks the response status code is considered as error .
* @ param httpResponse the response to check
* @ param decodeData the response metadata
* @ return true if the response status code is considered as error , false otherwise . */
static boolean isErrorStatus ( HttpResponse httpResponse , HttpResponseDecodeData decodeData ) { } }
|
final int [ ] expectedStatuses = decodeData . expectedStatusCodes ( ) ; if ( expectedStatuses != null ) { return ! contains ( expectedStatuses , httpResponse . statusCode ( ) ) ; } else { return httpResponse . statusCode ( ) / 100 != 2 ; }
|
public class AlignedBox3f { /** * Change the frame of the box .
* @ param x
* @ param y
* @ param z
* @ param sizex
* @ param sizey
* @ param sizez */
@ Override public void set ( double x , double y , double z , double sizex , double sizey , double sizez ) { } }
|
setFromCorners ( x , y , z , x + sizex , y + sizey , z + sizez ) ;
|
public class Parser { /** * Parse the value and return a new instance of RECORD .
* For this method to work the RECORD class may NOT be an inner class . */
public RECORD parse ( final String value ) throws DissectionFailure , InvalidDissectorException , MissingDissectorsException { } }
|
assembleDissectors ( ) ; final Parsable < RECORD > parsable = createParsable ( ) ; if ( parsable == null ) { return null ; } parsable . setRootDissection ( rootType , value ) ; return parse ( parsable ) . getRecord ( ) ;
|
public class SortWorker { /** * Write the provided pointer at the specified index .
* ( Assumes limit on buffer is correctly set )
* ( Position of the buffer changed ) */
private void writePointer ( int index , ByteBuffer pointer ) { } }
|
int limit = memoryBuffer . limit ( ) ; int pos = memoryBuffer . position ( ) ; int pointerOffset = computePointerOffset ( index ) ; memoryBuffer . limit ( pointerOffset + POINTER_SIZE_BYTES ) ; memoryBuffer . position ( pointerOffset ) ; memoryBuffer . put ( pointer ) ; memoryBuffer . limit ( limit ) ; memoryBuffer . position ( pos ) ;
|
public class AWSDatabaseMigrationServiceClient { /** * Applies a pending maintenance action to a resource ( for example , to a replication instance ) .
* @ param applyPendingMaintenanceActionRequest
* @ return Result of the ApplyPendingMaintenanceAction operation returned by the service .
* @ throws ResourceNotFoundException
* The resource could not be found .
* @ sample AWSDatabaseMigrationService . ApplyPendingMaintenanceAction
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / dms - 2016-01-01 / ApplyPendingMaintenanceAction "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public ApplyPendingMaintenanceActionResult applyPendingMaintenanceAction ( ApplyPendingMaintenanceActionRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeApplyPendingMaintenanceAction ( request ) ;
|
public class UnprocessedAccountMarshaller { /** * Marshall the given parameter object . */
public void marshall ( UnprocessedAccount unprocessedAccount , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( unprocessedAccount == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( unprocessedAccount . getAccountId ( ) , ACCOUNTID_BINDING ) ; protocolMarshaller . marshall ( unprocessedAccount . getResult ( ) , RESULT_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class AbstractRoxConfigurableClientMojo { /** * Apply the internal setup for the plugin
* @ throws MojoExecutionException Throws when error occurred in the clean plugin */
@ Override protected void setup ( ) throws MojoExecutionException { } }
|
if ( verbose ) { getLog ( ) . info ( "Rox configuration is generated" ) ; } // Check if the ROX configuration is available
if ( roxActive && roxConfig != null ) { // Check the ROX configuration file
if ( ! roxConfig . exists ( ) || ! roxConfig . isFile ( ) || ! roxConfig . getAbsolutePath ( ) . endsWith ( ".yml" ) ) { getLog ( ) . warn ( "The " + ROX_PROPERTIES_FILENAME + " configuration seems not to be a valid file or path is incorrect. Rox will be disabled." ) ; roxActive = false ; } else { try { // Prepare the resource to copy
Resource r = new Resource ( ) ; r . setFiltering ( true ) ; r . setDirectory ( roxConfig . getParent ( ) ) ; r . setIncludes ( Arrays . asList ( new String [ ] { roxConfig . getName ( ) } ) ) ; // Configure the resource filtering
MavenResourcesExecution mre = new MavenResourcesExecution ( Arrays . asList ( new Resource [ ] { r } ) , getWorkingDirectory ( ) , project , encoding , null , null , session ) ; // Filter the resources
mavenResourcesFiltering . filterResources ( mre ) ; } catch ( MavenFilteringException mfe ) { getLog ( ) . warn ( "Unable to filter the " + ROX_PROPERTIES_FILENAME + " file. Rox will be disabled." , mfe ) ; roxActive = false ; } } } else { getLog ( ) . info ( "No rox configuration to use" ) ; roxActive = false ; }
|
public class hostcpu { /** * < pre >
* Converts API response of bulk operation into object and returns the object array in case of get request .
* < / pre > */
protected base_resource [ ] get_nitro_bulk_response ( nitro_service service , String response ) throws Exception { } }
|
hostcpu_responses result = ( hostcpu_responses ) service . get_payload_formatter ( ) . string_to_resource ( hostcpu_responses . class , response ) ; if ( result . errorcode != 0 ) { if ( result . errorcode == SESSION_NOT_EXISTS ) service . clear_session ( ) ; throw new nitro_exception ( result . message , result . errorcode , ( base_response [ ] ) result . hostcpu_response_array ) ; } hostcpu [ ] result_hostcpu = new hostcpu [ result . hostcpu_response_array . length ] ; for ( int i = 0 ; i < result . hostcpu_response_array . length ; i ++ ) { result_hostcpu [ i ] = result . hostcpu_response_array [ i ] . hostcpu [ 0 ] ; } return result_hostcpu ;
|
public class Client { /** * Generates an invite link for a user that you have already created in your OneLogin account .
* @ param email
* Set to the email address of the user that you want to generate an invite link for .
* @ return String with the link
* @ throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
* @ throws OAuthProblemException - if there are errors validating the OneloginOAuthJSONResourceResponse and throwOAuthProblemException is enabled
* @ throws URISyntaxException - if there is an error when generating the target URL at the URIBuilder constructor
* @ see < a target = " _ blank " href = " https : / / developers . onelogin . com / api - docs / 1 / invite - links / generate - invite - link " > Generate Invite Link documentation < / a > */
public String generateInviteLink ( String email ) throws OAuthSystemException , OAuthProblemException , URISyntaxException { } }
|
cleanError ( ) ; prepareToken ( ) ; OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient ( ) ; OAuthClient oAuthClient = new OAuthClient ( httpClient ) ; URIBuilder url = new URIBuilder ( settings . getURL ( Constants . GENERATE_INVITE_LINK_URL ) ) ; OAuthClientRequest bearerRequest = new OAuthBearerClientRequest ( url . toString ( ) ) . buildHeaderMessage ( ) ; Map < String , String > headers = getAuthorizedHeader ( ) ; bearerRequest . setHeaders ( headers ) ; Map < String , Object > params = new HashMap < String , Object > ( ) ; params . put ( "email" , email ) ; String body = JSONUtils . buildJSON ( params ) ; bearerRequest . setBody ( body ) ; String urlLink = null ; OneloginOAuthJSONResourceResponse oAuthResponse = oAuthClient . resource ( bearerRequest , OAuth . HttpMethod . POST , OneloginOAuthJSONResourceResponse . class ) ; if ( oAuthResponse . getResponseCode ( ) == 200 ) { if ( oAuthResponse . getType ( ) . equals ( "success" ) ) { if ( oAuthResponse . getMessage ( ) . equals ( "Success" ) ) { Object [ ] objArray = oAuthResponse . getArrayFromData ( ) ; urlLink = ( String ) objArray [ 0 ] ; } } } else { error = oAuthResponse . getError ( ) ; errorDescription = oAuthResponse . getErrorDescription ( ) ; } return urlLink ;
|
public class PathResourceManager { /** * Returns true is some element of path inside base path is a symlink . */
private SymlinkResult getSymlinkBase ( final String base , final Path file ) throws IOException { } }
|
int nameCount = file . getNameCount ( ) ; Path root = fileSystem . getPath ( base ) ; int rootCount = root . getNameCount ( ) ; Path f = file ; for ( int i = nameCount - 1 ; i >= 0 ; i -- ) { if ( Files . isSymbolicLink ( f ) ) { return new SymlinkResult ( i + 1 > rootCount , f ) ; } f = f . getParent ( ) ; } return null ;
|
public class FiniteMapObligation { /** * idx in set dom m */
private List < PMultipleBind > getSetBindList ( ILexNameToken finmap , ILexNameToken findex ) { } }
|
AMapDomainUnaryExp domExp = new AMapDomainUnaryExp ( ) ; domExp . setType ( new ABooleanBasicType ( ) ) ; domExp . setExp ( getVarExp ( finmap ) ) ; return getMultipleSetBindList ( domExp , findex ) ;
|
public class SelectStatement { /** * Used by ModificationStatement for CAS operations */
void processColumnFamily ( ByteBuffer key , ColumnFamily cf , QueryOptions options , long now , Selection . ResultSetBuilder result ) throws InvalidRequestException { } }
|
CFMetaData cfm = cf . metadata ( ) ; ByteBuffer [ ] keyComponents = null ; if ( cfm . getKeyValidator ( ) instanceof CompositeType ) { keyComponents = ( ( CompositeType ) cfm . getKeyValidator ( ) ) . split ( key ) ; } else { keyComponents = new ByteBuffer [ ] { key } ; } Iterator < Cell > cells = cf . getSortedColumns ( ) . iterator ( ) ; if ( sliceRestriction != null ) cells = applySliceRestriction ( cells , options ) ; CQL3Row . RowIterator iter = cfm . comparator . CQL3RowBuilder ( cfm , now ) . group ( cells ) ; // If there is static columns but there is no non - static row , then provided the select was a full
// partition selection ( i . e . not a 2ndary index search and there was no condition on clustering columns )
// then we want to include the static columns in the result set ( and we ' re done ) .
CQL3Row staticRow = iter . getStaticRow ( ) ; if ( staticRow != null && ! iter . hasNext ( ) && ! usesSecondaryIndexing && hasNoClusteringColumnsRestriction ( ) ) { result . newRow ( ) ; for ( ColumnDefinition def : selection . getColumns ( ) ) { switch ( def . kind ) { case PARTITION_KEY : result . add ( keyComponents [ def . position ( ) ] ) ; break ; case STATIC : addValue ( result , def , staticRow , options ) ; break ; default : result . add ( ( ByteBuffer ) null ) ; } } return ; } while ( iter . hasNext ( ) ) { CQL3Row cql3Row = iter . next ( ) ; // Respect requested order
result . newRow ( ) ; // Respect selection order
for ( ColumnDefinition def : selection . getColumns ( ) ) { switch ( def . kind ) { case PARTITION_KEY : result . add ( keyComponents [ def . position ( ) ] ) ; break ; case CLUSTERING_COLUMN : result . add ( cql3Row . getClusteringColumn ( def . position ( ) ) ) ; break ; case COMPACT_VALUE : result . add ( cql3Row . getColumn ( null ) ) ; break ; case REGULAR : addValue ( result , def , cql3Row , options ) ; break ; case STATIC : addValue ( result , def , staticRow , options ) ; break ; } } }
|
public class Lexer { private Token doctype ( ) { } }
|
String val = scan1 ( "^!!! *([^\\n]+)?" ) ; if ( StringUtils . isNotBlank ( val ) ) { throw new JadeLexerException ( "`!!!` is deprecated, you must now use `doctype`" , filename , getLineno ( ) , templateLoader ) ; } Matcher matcher = scanner . getMatcherForPattern ( "^(?:doctype) *([^\\n]+)?" ) ; if ( matcher . find ( 0 ) && matcher . groupCount ( ) > 0 ) { int end = matcher . end ( ) ; consume ( end ) ; String name = matcher . group ( 1 ) ; if ( name != null && "5" . equals ( name . trim ( ) ) ) throw new JadeLexerException ( "`doctype 5` is deprecated, you must now use `doctype html`" , filename , getLineno ( ) , templateLoader ) ; return new Doctype ( name , lineno ) ; } return null ;
|
public class XsdEmitter { /** * Create an XML schema minInclusive facet .
* @ param minInclusive the value to set
* @ return an XML schema minInclusive facet */
protected XmlSchemaMinInclusiveFacet createMinInclusiveFacet ( final String minInclusive ) { } }
|
XmlSchemaMinInclusiveFacet xmlSchemaMinInclusiveFacet = new XmlSchemaMinInclusiveFacet ( ) ; xmlSchemaMinInclusiveFacet . setValue ( minInclusive ) ; return xmlSchemaMinInclusiveFacet ;
|
public class SignalExternalWorkflowExecutionInitiatedEventAttributesMarshaller { /** * Marshall the given parameter object . */
public void marshall ( SignalExternalWorkflowExecutionInitiatedEventAttributes signalExternalWorkflowExecutionInitiatedEventAttributes , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( signalExternalWorkflowExecutionInitiatedEventAttributes == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( signalExternalWorkflowExecutionInitiatedEventAttributes . getWorkflowId ( ) , WORKFLOWID_BINDING ) ; protocolMarshaller . marshall ( signalExternalWorkflowExecutionInitiatedEventAttributes . getRunId ( ) , RUNID_BINDING ) ; protocolMarshaller . marshall ( signalExternalWorkflowExecutionInitiatedEventAttributes . getSignalName ( ) , SIGNALNAME_BINDING ) ; protocolMarshaller . marshall ( signalExternalWorkflowExecutionInitiatedEventAttributes . getInput ( ) , INPUT_BINDING ) ; protocolMarshaller . marshall ( signalExternalWorkflowExecutionInitiatedEventAttributes . getDecisionTaskCompletedEventId ( ) , DECISIONTASKCOMPLETEDEVENTID_BINDING ) ; protocolMarshaller . marshall ( signalExternalWorkflowExecutionInitiatedEventAttributes . getControl ( ) , CONTROL_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class Event { /** * Replies if the event was emitted by an entity with the given identifier .
* @ param entityId the identifier of the emitter to test .
* @ return < code > true < / code > if the given event was emitted by
* an entity with the given identifier ; otherwise < code > false < / code > .
* @ since 0.2 */
@ Pure public boolean isFrom ( UUID entityId ) { } }
|
final Address iSource = getSource ( ) ; return ( entityId != null ) && ( iSource != null ) && entityId . equals ( iSource . getUUID ( ) ) ;
|
public class SrvAddTheFirstUser { /** * < p > Change user password . < / p >
* @ param pUserName User Name
* @ param pPassw User password
* @ param pPasswOld User password old
* @ return if changed ( if there is user with old password )
* @ throws Exception - an exception */
@ Override public final boolean changeUserPasswd ( final String pUserName , final String pPassw , final String pPasswOld ) throws Exception { } }
|
String query = "select USERTOMCAT.ITSUSER from USERTOMCAT where ITSUSER='" + pUserName + "' and ITSPASSWORD='" + pPasswOld + "';" ; IRecordSet < RS > recordSet = null ; try { this . srvDatabase . setIsAutocommit ( false ) ; this . srvDatabase . setTransactionIsolation ( ISrvDatabase . TRANSACTION_READ_UNCOMMITTED ) ; this . srvDatabase . beginTransaction ( ) ; recordSet = getSrvDatabase ( ) . retrieveRecords ( query ) ; if ( ! recordSet . moveToFirst ( ) ) { return false ; } String changeUserP = "update USERTOMCAT set ITSPASSWORD='" + pPassw + "' where ITSUSER='" + pUserName + "';" ; this . srvDatabase . executeQuery ( changeUserP ) ; this . srvDatabase . commitTransaction ( ) ; return true ; } catch ( Exception ex ) { this . srvDatabase . rollBackTransaction ( ) ; throw ex ; } finally { this . srvDatabase . releaseResources ( ) ; if ( recordSet != null ) { recordSet . close ( ) ; } }
|
public class CmsHelpTemplateBean { /** * Returns the HTML for the head frame of the online help . < p >
* @ return the HTML for the head frame of the online help */
public String displayHead ( ) { } }
|
StringBuffer result = new StringBuffer ( 2048 ) ; int buttonStyle = getSettings ( ) . getUserSettings ( ) . getWorkplaceButtonStyle ( ) ; // change to online project to allow exporting
try { getJsp ( ) . getRequestContext ( ) . setCurrentProject ( m_onlineProject ) ; String resourcePath = getJsp ( ) . link ( "/system/modules/" + MODULE_NAME + "/resources/" ) ; result . append ( buildHtmlHelpStart ( "workplace.css" , false ) ) ; result . append ( "<body class=\"buttons-head\" unselectable=\"on\">\n" ) ; result . append ( "<script type=\"text/javascript\" src=\"" ) ; result . append ( getJsp ( ) . link ( "/system/modules/org.opencms.workplace.help/resources/search.js" ) ) ; result . append ( "\"></script>\n" ) ; // store home link in JS variable to use it in body frame
result . append ( "<script type=\"text/javascript\">\n<!--\n" ) ; result . append ( "\tvar homeLink = \"" ) ; result . append ( CmsEncoder . escapeXml ( getParamHomelink ( ) ) ) ; result . append ( "\";\n\n" ) ; result . append ( "//-->\n</script>\n" ) ; // search form with invisible elements
// search index may be attached to resource / system / modules / org . opencms . workplace . help / elements / search . jsp ,
// property search . index .
String index = getJsp ( ) . property ( "search.index" , "/system/modules/org.opencms.workplace.help/elements/search.jsp" , "German online help" , false ) ; StringBuffer submitAction = new StringBuffer ( ) ; submitAction . append ( "parseSearchQuery(document.forms[\'searchform\'],\'" ) ; submitAction . append ( Messages . get ( ) . getBundle ( getLocale ( ) ) . key ( Messages . GUI_HELP_ERR_SEARCH_WORD_LENGTH_1 , new Integer ( 3 ) ) ) . append ( "\');" ) ; result . append ( "<form style=\"margin: 0;\" name=\"searchform\" method=\"post\" action=\"" ) ; String searchLink = getJsp ( ) . link ( new StringBuffer ( "/system/modules/org.opencms.workplace.help/elements/search.jsp?" ) . append ( CmsLocaleManager . PARAMETER_LOCALE ) . append ( "=" ) . append ( getLocale ( ) ) . toString ( ) ) ; result . append ( searchLink ) ; result . append ( "\" target=\"body\"" ) ; result . append ( " onsubmit=\"" ) ; result . append ( submitAction . toString ( ) ) ; result . append ( "\">\n" ) ; result . append ( " <input type=\"hidden\" name=\"action\" value=\"search\" />\n" ) ; result . append ( " <input type=\"hidden\" name=\"query\" value=\"\" />\n" ) ; result . append ( " <input type=\"hidden\" name=\"index\" value=\"" + index + "\" />\n" ) ; result . append ( " <input type=\"hidden\" name=\"searchPage\" value=\"1\" />\n" ) ; result . append ( "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n" ) ; result . append ( "<tr>\n" ) ; result . append ( "\t<td align=\"left\">\n" ) ; // display navigation buttons
result . append ( buttonBar ( HTML_START ) ) ; result . append ( buttonBarStartTab ( 0 , 5 ) ) ; result . append ( button ( "javascript:history.back();" , null , "back.png" , org . opencms . search . Messages . GUI_HELP_BUTTON_BACK_0 , buttonStyle , resourcePath ) ) ; result . append ( button ( "javascript:history.forward();" , null , "next.png" , org . opencms . search . Messages . GUI_HELP_BUTTON_NEXT_0 , buttonStyle , resourcePath ) ) ; result . append ( button ( "javascript:top.body.location.href='" + CmsEncoder . escapeXml ( getParamHomelink ( ) ) + "';" , null , "contents.png" , org . opencms . search . Messages . GUI_HELP_BUTTON_CONTENTS_0 , buttonStyle , resourcePath ) ) ; // search
result . append ( "<td style=\"vertical-align: top;\">" ) ; result . append ( "<input type=\"text\" name=\"query2\" class=\"onlineform\" style=\"width: 120px\" value=\"" ) ; result . append ( "" ) ; result . append ( " \">" ) ; result . append ( "</td>\n" ) ; result . append ( button ( new StringBuffer ( "javascript:" ) . append ( submitAction . toString ( ) ) . toString ( ) , null , null , org . opencms . search . Messages . GUI_HELP_BUTTON_SEARCH_0 , 2 , null ) ) ; result . append ( buttonBar ( HTML_END ) ) ; result . append ( "</td>\n" ) ; result . append ( "\t<td align=\"right\" width=\"100%\">\n" ) ; // display close button
result . append ( buttonBar ( HTML_START ) ) ; result . append ( buttonBarSeparator ( 5 , 0 ) ) ; result . append ( button ( "javascript:top.close();" , null , "close" , org . opencms . search . Messages . GUI_HELP_BUTTON_CLOSE_0 , buttonStyle , resourcePath ) ) ; result . append ( buttonBar ( HTML_END ) ) ; result . append ( "\t</td>\n" ) ; result . append ( "\t<td> </td>\n" ) ; result . append ( "<td>" ) ; // display logo
result . append ( "<span style=\"display: block; width: 80px; height: 22px; background-image: url(\'" ) ; result . append ( getSkinUri ( ) ) ; result . append ( "commons/workplace.png" ) ; result . append ( "\'); \"></span>" ) ; result . append ( "</td>" ) ; result . append ( "</tr>\n" ) ; result . append ( "</table>\n" ) ; result . append ( "</form>\n" ) ; result . append ( buildHtmlHelpEnd ( ) ) ; return result . toString ( ) ; } finally { // set back to offline project
getJsp ( ) . getRequestContext ( ) . setCurrentProject ( m_offlineProject ) ; }
|
public class ByteAccessor { /** * ( non - Javadoc )
* @ see
* com . impetus . kundera . property . PropertyAccessor # fromString ( java . lang . String */
@ Override public Byte fromString ( Class targetClass , String s ) { } }
|
try { if ( s == null ) { return null ; } Byte b = new Byte ( s ) ; return b ; } catch ( NumberFormatException e ) { log . error ( "Number fromat exception, Caused by {}." , e ) ; throw new PropertyAccessException ( e ) ; }
|
public class JSConsumerClassifications { /** * Retrieve the number of classifications specified in the current set .
* @ return */
public int getNumberOfClasses ( ) { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getNumberOfClasses" ) ; SibTr . exit ( tc , "getNumberOfClasses" , Integer . valueOf ( numberOfClasses ) ) ; } return numberOfClasses ;
|
public class CmsDecorationMap { /** * Fills the decoration map with values from the decoation file . < p >
* @ param cms the CmsObject
* @ param res the decoration file
* @ return decoration map , using decoration as key and decoration description as value
* @ throws CmsException if something goes wrong */
private Map < String , CmsDecorationObject > fillMap ( CmsObject cms , CmsResource res ) throws CmsException { } }
|
if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_DECORATION_MAP_FILL_MAP_2 , m_name , m_decoratorDefinition ) ) ; } Map < String , CmsDecorationObject > decMap = new HashMap < String , CmsDecorationObject > ( ) ; // upgrade the resource to get the file content
CmsFile file = cms . readFile ( res ) ; // get all the entries
String unparsedContent = new String ( file . getContents ( ) ) ; String delimiter = "\r\n" ; if ( unparsedContent . indexOf ( delimiter ) == - 1 ) { // there was no \ r \ n delimiter in the csv file , so check if the lines are seperated by
// \ n only
if ( unparsedContent . indexOf ( "\n" ) > - 1 ) { delimiter = "\n" ; } } if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_DECORATION_MAP_FILL_MAP_DELIMITER_2 , res . getName ( ) , CmsStringUtil . escapeJavaScript ( delimiter ) ) ) ; } List < String > entries = CmsStringUtil . splitAsList ( unparsedContent , delimiter ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_DECORATION_MAP_FILL_MAP_SPLIT_LIST_2 , res . getName ( ) , entries ) ) ; } Iterator < String > i = entries . iterator ( ) ; while ( i . hasNext ( ) ) { try { String entry = i . next ( ) ; // extract key and value
if ( CmsStringUtil . isNotEmpty ( entry ) ) { int speratator = entry . indexOf ( CSV_SEPERATOR ) ; if ( speratator > - 1 ) { String key = entry . substring ( 0 , speratator ) . trim ( ) ; String value = entry . substring ( speratator + 1 ) . trim ( ) ; if ( CmsStringUtil . isNotEmpty ( key ) && CmsStringUtil . isNotEmpty ( value ) ) { CmsDecorationObject decObj = new CmsDecorationObject ( key , value , m_decoratorDefinition , m_locale ) ; decMap . put ( key , decObj ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_DECORATION_MAP_ADD_DECORATION_OBJECT_2 , decObj , key ) ) ; } } } } } catch ( Exception e ) { if ( LOG . isErrorEnabled ( ) ) { LOG . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_DECORATION_MAP_FILL_2 , m_name , e ) ) ; } } } return decMap ;
|
public class ConfigurationReader { /** * Parses the cache parameter section .
* @ param node
* Reference to the current used xml node
* @ param config
* Reference to the ConfigSettings */
private void parseCacheConfig ( final Node node , final ConfigSettings config ) { } }
|
String name ; Long lValue ; Node nnode ; NodeList list = node . getChildNodes ( ) ; int length = list . getLength ( ) ; for ( int i = 0 ; i < length ; i ++ ) { nnode = list . item ( i ) ; name = nnode . getNodeName ( ) . toUpperCase ( ) ; if ( name . equals ( KEY_LIMIT_TASK_SIZE_REVISIONS ) ) { lValue = Long . parseLong ( nnode . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ) ; config . setConfigParameter ( ConfigurationKeys . LIMIT_TASK_SIZE_REVISIONS , lValue ) ; } else if ( name . equals ( KEY_LIMIT_TASK_SIZE_DIFFS ) ) { lValue = Long . parseLong ( nnode . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ) ; config . setConfigParameter ( ConfigurationKeys . LIMIT_TASK_SIZE_DIFFS , lValue ) ; } else if ( name . equals ( KEY_LIMIT_SQLSERVER_MAX_ALLOWED_PACKET ) ) { lValue = Long . parseLong ( nnode . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ) ; config . setConfigParameter ( ConfigurationKeys . LIMIT_SQLSERVER_MAX_ALLOWED_PACKET , lValue ) ; } }
|
public class ConnectionManager { /** * Finds or opens a client to talk to the dbserver on the specified player , incrementing its use count .
* @ param targetPlayer the player number whose database needs to be interacted with
* @ param description a short description of the task being performed for error reporting if it fails ,
* should be a verb phrase like " requesting track metadata "
* @ return the communication client for talking to that player , or { @ code null } if the player could not be found
* @ throws IllegalStateException if we can ' t find the target player or there is no suitable player number for us
* to pretend to be
* @ throws IOException if there is a problem communicating */
private synchronized Client allocateClient ( int targetPlayer , String description ) throws IOException { } }
|
Client result = openClients . get ( targetPlayer ) ; if ( result == null ) { // We need to open a new connection .
final DeviceAnnouncement deviceAnnouncement = DeviceFinder . getInstance ( ) . getLatestAnnouncementFrom ( targetPlayer ) ; if ( deviceAnnouncement == null ) { throw new IllegalStateException ( "Player " + targetPlayer + " could not be found " + description ) ; } final int dbServerPort = getPlayerDBServerPort ( targetPlayer ) ; if ( dbServerPort < 0 ) { throw new IllegalStateException ( "Player " + targetPlayer + " does not have a db server " + description ) ; } final byte posingAsPlayerNumber = ( byte ) chooseAskingPlayerNumber ( targetPlayer ) ; Socket socket = null ; try { InetSocketAddress address = new InetSocketAddress ( deviceAnnouncement . getAddress ( ) , dbServerPort ) ; socket = new Socket ( ) ; socket . connect ( address , socketTimeout . get ( ) ) ; socket . setSoTimeout ( socketTimeout . get ( ) ) ; result = new Client ( socket , targetPlayer , posingAsPlayerNumber ) ; } catch ( IOException e ) { try { socket . close ( ) ; } catch ( IOException e2 ) { logger . error ( "Problem closing socket for failed client creation attempt " + description ) ; } throw e ; } openClients . put ( targetPlayer , result ) ; useCounts . put ( result , 0 ) ; } useCounts . put ( result , useCounts . get ( result ) + 1 ) ; return result ;
|
public class DecoderCache { /** * Populates the cache . */
private static void populateCache ( ) { } }
|
if ( cache == null ) { cache = new LinkedHashMap < > ( ) ; logger . info ( "IDataDecoders found:" ) ; ServiceLoader < IDataDecoder > loader = ServiceLoader . load ( IDataDecoder . class ) ; // Logging .
for ( IDataDecoder discoveredDecoder : loader ) { String name = discoveredDecoder . getClass ( ) . getCanonicalName ( ) ; String decoderMimeType = discoveredDecoder . getMimeType ( ) ; logger . info ( String . format ( " %s -> %s" , decoderMimeType , name ) ) ; cache . put ( decoderMimeType , discoveredDecoder . getClass ( ) ) ; } }
|
public class DbPipe { public String getStringValue ( String name ) { } }
|
// Check if datum exists for name
DbDatum datum = getDatum ( name ) ; if ( datum == null ) return null ; // Else get string value
String [ ] array = datum . extractStringArray ( ) ; String str = "" ; for ( int i = 0 ; i < array . length ; i ++ ) { str += array [ i ] ; if ( i < array . length - 1 ) str += "\n" ; } return str ;
|
public class TreeWithIDSearcher { /** * Fill all items with the same ID by linearly scanning of the tree .
* @ param < KEYTYPE >
* tree ID type
* @ param < DATATYPE >
* tree data type
* @ param < ITEMTYPE >
* tree item type
* @ param aTree
* The tree to search . May not be < code > null < / code > .
* @ param aSearchID
* The ID to search . May not be < code > null < / code > .
* @ return A non - < code > null < / code > list with all matching items . */
@ Nonnull @ ReturnsMutableCopy public static < KEYTYPE , DATATYPE , ITEMTYPE extends ITreeItemWithID < KEYTYPE , DATATYPE , ITEMTYPE > > ICommonsList < ITEMTYPE > findAllItemsWithIDRecursive ( @ Nonnull final IBasicTree < DATATYPE , ITEMTYPE > aTree , @ Nullable final KEYTYPE aSearchID ) { } }
|
return findAllItemsWithIDRecursive ( aTree . getRootItem ( ) , aSearchID ) ;
|
public class AStar { /** * Run the A * algorithm assuming that the graph is oriented is
* an orientation tool was passed to the constructor .
* < p > The orientation of the graph may also be overridden by the implementations
* of the { @ link AStarNode A * nodes } .
* @ param startPoint is the starting point .
* @ param endPoint is the point to reach .
* @ return the found path , or < code > null < / code > if none found . */
protected GP solve ( AStarNode < ST , PT > startPoint , PT endPoint ) { } }
|
final List < AStarNode < ST , PT > > closeList ; fireAlgorithmStart ( startPoint , endPoint ) ; // Run A *
closeList = findPath ( startPoint , endPoint ) ; if ( closeList == null || closeList . isEmpty ( ) ) { return null ; } fireAlgorithmEnd ( closeList ) ; // Create the path
return createPath ( startPoint , endPoint , closeList ) ;
|
public class ApiOvhPrice { /** * Get price of anti - DDos Pro option
* REST : GET / price / dedicated / server / antiDDoSPro / { commercialRange }
* @ param commercialRange [ required ] commercial range of your dedicated server */
public OvhPrice dedicated_server_antiDDoSPro_commercialRange_GET ( net . minidev . ovh . api . price . dedicated . server . OvhAntiDDoSProEnum commercialRange ) throws IOException { } }
|
String qPath = "/price/dedicated/server/antiDDoSPro/{commercialRange}" ; StringBuilder sb = path ( qPath , commercialRange ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhPrice . class ) ;
|
public class TargetableInterceptor { /** * { @ inheritDoc } */
@ Override public void paint ( final RenderContext renderContext ) { } }
|
ComponentWithContext target = WebUtilities . getComponentById ( targetId , true ) ; if ( target == null ) { throw new SystemException ( "No target component found for id " + targetId ) ; } UIContextHolder . pushContext ( target . getContext ( ) ) ; try { super . paint ( renderContext ) ; } finally { UIContextHolder . popContext ( ) ; }
|
public class Indicator { /** * Sets the color definition that is used to visualize the on state of the symbol
* @ param ON _ COLOR */
public void setOnColor ( final ColorDef ON_COLOR ) { } }
|
onColor = ON_COLOR ; init ( getInnerBounds ( ) . width , getInnerBounds ( ) . height ) ; repaint ( getInnerBounds ( ) ) ;
|
public class AddressTemplate { /** * - - - - - resolve */
public ResourceAddress resolve ( String ... wildcards ) { } }
|
return resolve ( new StatementContext ( ) { @ Override public String get ( String key ) { return null ; } @ Override public String [ ] getTuple ( String key ) { return null ; } @ Override public String resolve ( String key ) { return null ; } @ Override public String [ ] resolveTuple ( String key ) { return null ; } @ Override public LinkedList < String > collect ( String key ) { return null ; } @ Override public LinkedList < String [ ] > collectTuples ( String key ) { return null ; } } , wildcards ) ;
|
public class UserServiceImpl { /** * { @ inheritDoc }
* 安全考虑 , password 属性为 null 。 < / p > */
public User get ( String loginname , String password ) { } }
|
Connection conn = null ; User user = null ; if ( loginname == null || password == null ) return null ; String cryptpassword = MD5 . encodeString ( password , null ) ; try { conn = ConnectionUtils . getConnection ( ) ; user = userDAO . get ( conn , loginname , cryptpassword ) ; } catch ( SQLException e ) { logger . error ( e . getMessage ( ) ) ; } finally { DbUtils . closeQuietly ( conn ) ; } return user ;
|
public class SparkDataValidation { /** * Validate DataSet objects saved to the specified directory on HDFS by attempting to load them and checking their
* contents . Assumes DataSets were saved using { @ link org . nd4j . linalg . dataset . DataSet # save ( OutputStream ) } . < br >
* This method ( optionally ) additionally validates the arrays using the specified shapes for the features and labels .
* Note : this method will also consider all files in subdirectories ( i . e . , is recursive ) .
* @ param sc Spark context
* @ param path HDFS path of the directory containing the saved DataSet objects
* @ param featuresShape May be null . If non - null : feature arrays must match the specified shape , for all values with
* shape > 0 . For example , if featuresShape = { - 1,10 } then the features must be rank 2,
* can have any size for the first dimension , but must have size 10 for the second dimension .
* @ param labelsShape As per featuresShape , but for the labels instead
* @ return Results of the validation */
public static ValidationResult validateDataSets ( JavaSparkContext sc , String path , int [ ] featuresShape , int [ ] labelsShape ) { } }
|
return validateDataSets ( sc , path , true , false , featuresShape , labelsShape ) ;
|
public class ArrayUtils { /** * 将给定数组转换成Set 。 注意 : 相同hashCode的元素将只保留一个 。 Convert given array to a set .
* @ param array 源数组 。 source array .
* @ return 一个保留所有唯一元素的Set 。 a set have all unique element of array . */
public static < T > Set < T > toSet ( final T [ ] array ) { } }
|
if ( isNotEmpty ( array ) ) { Set < T > set = new HashSet < T > ( array . length ) ; for ( T element : array ) { set . add ( element ) ; } return set ; } else { return new HashSet < T > ( 0 ) ; }
|
public class SyndFeedInput { /** * Builds SyndFeedImpl from an JDOM document .
* @ param document JDOM document to read to create the SyndFeedImpl .
* @ return the SyndFeedImpl read from the JDOM document .
* @ throws IllegalArgumentException thrown if feed type could not be understood by any of the
* underlying parsers .
* @ throws FeedException if the feed could not be parsed */
public SyndFeed build ( final Document document ) throws IllegalArgumentException , FeedException { } }
|
return new SyndFeedImpl ( feedInput . build ( document ) , preserveWireFeed ) ;
|
public class NDArrayIndex { /** * Given an array of indexes
* return the number of new axis elements
* in teh array
* @ param axes the indexes to get the number
* of new axes for
* @ return the number of new axis elements in the given array */
public static int numNewAxis ( INDArrayIndex ... axes ) { } }
|
int ret = 0 ; for ( INDArrayIndex index : axes ) if ( index instanceof NewAxis ) ret ++ ; return ret ;
|
public class ExternalEntryPointHelper { /** * Deeply finds all the attributes of the supplied class
* @ param parameterType Type of parameter
* @ param typeBlacklist blackList by type
* @ param nameBlacklist blackList by name
* @ param maxDeepLevel How deep should algorithm go in the object
* @ return List */
public static List < EntryPointParameter > getInternalEntryPointParametersRecursively ( Class < ? > parameterType , Set < Class < ? > > typeBlacklist , Set < String > nameBlacklist , int maxDeepLevel ) { } }
|
return getInternalEntryPointParametersRecursively ( parameterType , typeBlacklist , nameBlacklist , null , 1 , maxDeepLevel ) ;
|
public class ListProtectionsResult { /** * The array of enabled < a > Protection < / a > objects .
* @ param protections
* The array of enabled < a > Protection < / a > objects . */
public void setProtections ( java . util . Collection < Protection > protections ) { } }
|
if ( protections == null ) { this . protections = null ; return ; } this . protections = new java . util . ArrayList < Protection > ( protections ) ;
|
public class ExperimentsInner { /** * Gets information about an Experiment .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param workspaceName The name of the workspace . Workspace names can only contain a combination of alphanumeric characters along with dash ( - ) and underscore ( _ ) . The name must be from 1 through 64 characters long .
* @ param experimentName The name of the experiment . Experiment names can only contain a combination of alphanumeric characters along with dash ( - ) and underscore ( _ ) . The name must be from 1 through 64 characters long .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws CloudException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the ExperimentInner object if successful . */
public ExperimentInner get ( String resourceGroupName , String workspaceName , String experimentName ) { } }
|
return getWithServiceResponseAsync ( resourceGroupName , workspaceName , experimentName ) . toBlocking ( ) . single ( ) . body ( ) ;
|
public class AbstractLifeCycleManager { /** * Builds the right handler depending on the current instance ' s state .
* @ param instance an instance
* @ param appName the application name
* @ param messagingClient the messaging client
* @ return a non - null manager to update the instance ' s life cycle */
public static AbstractLifeCycleManager build ( Instance instance , String appName , IAgentClient messagingClient ) { } }
|
AbstractLifeCycleManager result ; switch ( instance . getStatus ( ) ) { case DEPLOYED_STARTED : result = new DeployedStarted ( appName , messagingClient ) ; break ; case DEPLOYED_STOPPED : result = new DeployedStopped ( appName , messagingClient ) ; break ; case NOT_DEPLOYED : result = new NotDeployed ( appName , messagingClient ) ; break ; case UNRESOLVED : result = new Unresolved ( appName , messagingClient ) ; break ; case WAITING_FOR_ANCESTOR : result = new WaitingForAncestor ( appName , messagingClient ) ; break ; default : result = new TransitiveStates ( appName , messagingClient ) ; break ; } return result ;
|
public class RegexReplacer { /** * Compiles if not compiled . Replaces found string by using attached replacers .
* < p > This method is thread safe :
* @ param text
* @ return */
public String replace ( CharSequence text ) { } }
|
StringBuilder sb = new StringBuilder ( ) ; replace ( sb , text ) ; return sb . toString ( ) ;
|
public class CollectionPrefetcher { /** * associate the batched Children with their owner object loop over children */
protected void associateBatched ( Collection owners , Collection children ) { } }
|
CollectionDescriptor cds = getCollectionDescriptor ( ) ; PersistentField field = cds . getPersistentField ( ) ; PersistenceBroker pb = getBroker ( ) ; Class ownerTopLevelClass = pb . getTopLevelClass ( getOwnerClassDescriptor ( ) . getClassOfObject ( ) ) ; Class collectionClass = cds . getCollectionClass ( ) ; // this collection type will be used :
HashMap ownerIdsToLists = new HashMap ( owners . size ( ) ) ; IdentityFactory identityFactory = pb . serviceIdentity ( ) ; // initialize the owner list map
for ( Iterator it = owners . iterator ( ) ; it . hasNext ( ) ; ) { Object owner = it . next ( ) ; ownerIdsToLists . put ( identityFactory . buildIdentity ( getOwnerClassDescriptor ( ) , owner ) , new ArrayList ( ) ) ; } // build the children lists for the owners
for ( Iterator it = children . iterator ( ) ; it . hasNext ( ) ; ) { Object child = it . next ( ) ; // BRJ : use cld for real class , relatedObject could be Proxy
ClassDescriptor cld = getDescriptorRepository ( ) . getDescriptorFor ( ProxyHelper . getRealClass ( child ) ) ; Object [ ] fkValues = cds . getForeignKeyValues ( child , cld ) ; Identity ownerId = identityFactory . buildIdentity ( null , ownerTopLevelClass , fkValues ) ; List list = ( List ) ownerIdsToLists . get ( ownerId ) ; if ( list != null ) { list . add ( child ) ; } } // connect children list to owners
for ( Iterator it = owners . iterator ( ) ; it . hasNext ( ) ; ) { Object result ; Object owner = it . next ( ) ; Identity ownerId = identityFactory . buildIdentity ( owner ) ; List list = ( List ) ownerIdsToLists . get ( ownerId ) ; if ( ( collectionClass == null ) && field . getType ( ) . isArray ( ) ) { int length = list . size ( ) ; Class itemtype = field . getType ( ) . getComponentType ( ) ; result = Array . newInstance ( itemtype , length ) ; for ( int j = 0 ; j < length ; j ++ ) { Array . set ( result , j , list . get ( j ) ) ; } } else { ManageableCollection col = createCollection ( cds , collectionClass ) ; for ( Iterator it2 = list . iterator ( ) ; it2 . hasNext ( ) ; ) { col . ojbAdd ( it2 . next ( ) ) ; } result = col ; } Object value = field . get ( owner ) ; if ( ( value instanceof CollectionProxyDefaultImpl ) && ( result instanceof Collection ) ) { ( ( CollectionProxyDefaultImpl ) value ) . setData ( ( Collection ) result ) ; } else { field . set ( owner , result ) ; } }
|
public class ICUService { /** * Convenience override of getDisplayNames ( ULocale , Comparator , String ) that
* uses null for the comparator , and null for the matchID . */
public SortedMap < String , String > getDisplayNames ( ULocale locale ) { } }
|
return getDisplayNames ( locale , null , null ) ;
|
public class Word2VecExamples { /** * Loads a model and allows user to find similar words */
public static void loadModel ( ) throws IOException , TException , UnknownWordException { } }
|
final Word2VecModel model ; try ( ProfilingTimer timer = ProfilingTimer . create ( LOG , "Loading model" ) ) { String json = Common . readFileToString ( new File ( "text8.model" ) ) ; model = Word2VecModel . fromThrift ( ThriftUtils . deserializeJson ( new Word2VecModelThrift ( ) , json ) ) ; } interact ( model . forSearch ( ) ) ;
|
public class ModMessageManager { /** * Checks if parameters passed match the parameteres required for the { @ link Method } .
* @ param method the method
* @ param data the data
* @ return true , if successful */
private static boolean checkParameters ( Method method , Object ... data ) { } }
|
Parameter [ ] parameters = method . getParameters ( ) ; if ( ArrayUtils . isEmpty ( data ) && parameters . length != 0 ) return false ; if ( parameters . length != data . length ) return false ; for ( int i = 0 ; i < parameters . length ; i ++ ) { Class < ? > paramClass = parameters [ i ] . getType ( ) ; if ( data [ i ] != null ) { Class < ? > dataClass = data [ i ] . getClass ( ) ; if ( ! ClassUtils . isAssignable ( dataClass , paramClass , true ) ) return false ; } } return true ;
|
public class ListDevicePoolsResult { /** * Information about the device pools .
* @ param devicePools
* Information about the device pools . */
public void setDevicePools ( java . util . Collection < DevicePool > devicePools ) { } }
|
if ( devicePools == null ) { this . devicePools = null ; return ; } this . devicePools = new java . util . ArrayList < DevicePool > ( devicePools ) ;
|
public class DefaultGroovyMethods { /** * Returns a List containing the items from the List but with duplicates removed
* using the natural ordering of the items to determine uniqueness .
* < pre class = " groovyTestCase " >
* def letters = [ ' c ' , ' a ' , ' t ' , ' s ' , ' a ' , ' t ' , ' h ' , ' a ' , ' t ' ]
* def expected = [ ' c ' , ' a ' , ' t ' , ' s ' , ' h ' ]
* assert letters . toUnique ( ) = = expected
* < / pre >
* @ param self a List
* @ return the List of non - duplicate items
* @ since 2.4.0 */
public static < T > List < T > toUnique ( List < T > self ) { } }
|
return toUnique ( self , ( Comparator < T > ) null ) ;
|
public class CassandraSchemaManager { /** * Gets the column family properties .
* @ param tableInfo
* the table info
* @ return the column family properties */
private Properties getColumnFamilyProperties ( TableInfo tableInfo ) { } }
|
if ( tables != null ) { for ( Table table : tables ) { if ( table != null && table . getName ( ) != null && table . getName ( ) . equalsIgnoreCase ( tableInfo . getTableName ( ) ) ) { return table . getProperties ( ) ; } } } return null ;
|
public class CmsUploadPropertyDialog { /** * Action to display the dialog content for the previous resource . < p > */
protected void actionBack ( ) { } }
|
if ( m_dialogIndex <= 0 ) { return ; } m_dialogIndex -- ; m_uploadPropertyPanel . getPropertyEditor ( ) . getForm ( ) . validateAndSubmit ( ) ; m_nextAction = new Runnable ( ) { public void run ( ) { loadDialogBean ( m_resources . get ( m_dialogIndex ) ) ; } } ;
|
public class MetricValues { /** * Obtains the { @ code HashCode } for the contents of { @ code value } .
* @ param value a { @ code MetricValue } to be signed
* @ return the { @ code HashCode } corresponding to { @ code value } */
public static HashCode sign ( MetricValue value ) { } }
|
Hasher h = Hashing . md5 ( ) . newHasher ( ) ; return putMetricValue ( h , value ) . hash ( ) ;
|
public class Table { /** * Returns only the columns whose names are given in the input array */
public List < CategoricalColumn < ? > > categoricalColumns ( String ... columnNames ) { } }
|
List < CategoricalColumn < ? > > columns = new ArrayList < > ( ) ; for ( String columnName : columnNames ) { columns . add ( categoricalColumn ( columnName ) ) ; } return columns ;
|
public class CGCSGIDImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setGCSGID ( Integer newGCSGID ) { } }
|
Integer oldGCSGID = gcsgid ; gcsgid = newGCSGID ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . CGCSGID__GCSGID , oldGCSGID , gcsgid ) ) ;
|
public class JMTimeUtil { /** * Gets time .
* @ param epochTimestamp the epoch timestamp
* @ param dateTimeFormatter the date time formatter
* @ param zoneId the zone id
* @ return the time */
public static String getTime ( long epochTimestamp , DateTimeFormatter dateTimeFormatter , ZoneId zoneId ) { } }
|
return ZonedDateTime . ofInstant ( Instant . ofEpochMilli ( epochTimestamp ) , zoneId ) . format ( dateTimeFormatter ) ;
|
public class RequestParameters { /** * Appends a list of values to the list for a parameter .
* @ param namethe parameter
* @ param valuesthe values to add to the list */
public void add ( String name , String ... values ) { } }
|
if ( containsKey ( name ) ) { List < String > list = get ( name ) ; for ( String value : values ) { list . add ( value ) ; } } else { put ( name , values ) ; }
|
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public PGPRGPGorient createPGPRGPGorientFromString ( EDataType eDataType , String initialValue ) { } }
|
PGPRGPGorient result = PGPRGPGorient . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
|
public class DRL6Expressions { /** * src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 273:1 : exclusiveOrExpression returns [ BaseDescr result ] : left = andExpression ( XOR right = andExpression ) * ; */
public final BaseDescr exclusiveOrExpression ( ) throws RecognitionException { } }
|
BaseDescr result = null ; BaseDescr left = null ; BaseDescr right = null ; try { // src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 274:3 : ( left = andExpression ( XOR right = andExpression ) * )
// src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 274:5 : left = andExpression ( XOR right = andExpression ) *
{ pushFollow ( FOLLOW_andExpression_in_exclusiveOrExpression1383 ) ; left = andExpression ( ) ; state . _fsp -- ; if ( state . failed ) return result ; if ( state . backtracking == 0 ) { if ( buildDescr ) { result = left ; } } // src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 275:3 : ( XOR right = andExpression ) *
loop29 : while ( true ) { int alt29 = 2 ; int LA29_0 = input . LA ( 1 ) ; if ( ( LA29_0 == XOR ) ) { alt29 = 1 ; } switch ( alt29 ) { case 1 : // src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 275:5 : XOR right = andExpression
{ match ( input , XOR , FOLLOW_XOR_in_exclusiveOrExpression1391 ) ; if ( state . failed ) return result ; pushFollow ( FOLLOW_andExpression_in_exclusiveOrExpression1395 ) ; right = andExpression ( ) ; state . _fsp -- ; if ( state . failed ) return result ; if ( state . backtracking == 0 ) { if ( buildDescr ) { ConstraintConnectiveDescr descr = ConstraintConnectiveDescr . newXor ( ) ; descr . addOrMerge ( result ) ; descr . addOrMerge ( right ) ; result = descr ; } } } break ; default : break loop29 ; } } } } catch ( RecognitionException re ) { throw re ; } finally { // do for sure before leaving
} return result ;
|
public class ServletRegistrationComponent { /** * The method to use when all the dependencies are resolved .
* It means iPojo guarantees that both the manager and the HTTP
* service are not null .
* @ throws Exception in case of critical error */
public void starting ( ) throws Exception { } }
|
this . logger . fine ( "iPojo registers REST and icons servlets related to Roboconf's DM." ) ; // Create the REST application with its resources .
// The scheduler may be null , it is optional .
this . app = new RestApplication ( this . manager ) ; this . app . setScheduler ( this . scheduler ) ; this . app . setMavenResolver ( this . mavenResolver ) ; this . app . enableCors ( this . enableCors ) ; this . app . setAuthenticationManager ( this . authenticationMngr ) ; Dictionary < String , String > initParams = new Hashtable < > ( ) ; initParams . put ( "servlet-name" , "Roboconf DM (REST)" ) ; this . jerseyServlet = new ServletContainer ( this . app ) ; this . httpService . registerServlet ( REST_CONTEXT , this . jerseyServlet , initParams , null ) ; // Deal with the icons servlet
initParams = new Hashtable < > ( ) ; initParams . put ( "servlet-name" , "Roboconf DM (icons)" ) ; IconServlet iconServlet = new IconServlet ( this . manager ) ; this . httpService . registerServlet ( ICONS_CONTEXT , iconServlet , initParams , null ) ; // Register the web socket
initParams = new Hashtable < > ( ) ; initParams . put ( "servlet-name" , "Roboconf DM (websocket)" ) ; RoboconfWebSocketServlet websocketServlet = new RoboconfWebSocketServlet ( ) ; this . httpService . registerServlet ( WEBSOCKET_CONTEXT , websocketServlet , initParams , null ) ; // Register a filter for authentication
this . authenticationFilter = new AuthenticationFilter ( this ) ; this . authenticationFilter . setAuthenticationEnabled ( this . enableAuthentication ) ; this . authenticationFilter . setAuthenticationManager ( this . authenticationMngr ) ; this . authenticationFilter . setSessionPeriod ( this . sessionPeriod ) ; this . authenticationFilter . setEnableCors ( this . enableCors ) ; initParams = new Hashtable < > ( ) ; initParams . put ( "urlPatterns" , "*" ) ; // Consider the bundle context can be null ( e . g . when used outside of OSGi )
if ( this . bundleContext != null ) this . filterServiceRegistration = this . bundleContext . registerService ( Filter . class , this . authenticationFilter , initParams ) ; else this . logger . warning ( "No bundle context was available, the authentication filter was not registered." ) ;
|
public class Privacy { /** * CHECKSTYLE : ON */
@ Override protected IQChildElementXmlStringBuilder getIQChildElementBuilder ( IQChildElementXmlStringBuilder buf ) { } }
|
buf . rightAngleBracket ( ) ; // CHECKSTYLE : OFF
// Add the active tag
if ( this . isDeclineActiveList ( ) ) { buf . append ( "<active/>" ) ; } else { if ( this . getActiveName ( ) != null ) { buf . append ( "<active name=\"" ) . escape ( getActiveName ( ) ) . append ( "\"/>" ) ; } } // Add the default tag
if ( this . isDeclineDefaultList ( ) ) { buf . append ( "<default/>" ) ; } else { if ( this . getDefaultName ( ) != null ) { buf . append ( "<default name=\"" ) . escape ( getDefaultName ( ) ) . append ( "\"/>" ) ; } } // Add the list with their privacy items
for ( Map . Entry < String , List < PrivacyItem > > entry : this . getItemLists ( ) . entrySet ( ) ) { String listName = entry . getKey ( ) ; List < PrivacyItem > items = entry . getValue ( ) ; // Begin the list tag
if ( items . isEmpty ( ) ) { buf . append ( "<list name=\"" ) . escape ( listName ) . append ( "\"/>" ) ; } else { buf . append ( "<list name=\"" ) . escape ( listName ) . append ( "\">" ) ; } for ( PrivacyItem item : items ) { // Append the item xml representation
buf . append ( item . toXML ( ) ) ; } // Close the list tag
if ( ! items . isEmpty ( ) ) { buf . append ( "</list>" ) ; } } // CHECKSTYLE : ON
return buf ;
|
public class TEEJBInvocationInfo { /** * This is called by the EJB container server code to write a
* EJB method call postinvoke begins record to the trace log , if enabled . */
public static void tracePostInvokeBegins ( EJSDeployedSupport s , EJSWrapperBase wrapper ) { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { StringBuffer sbuf = new StringBuffer ( ) ; sbuf . append ( MthdPostInvokeEntry_Type_Str ) . append ( DataDelimiter ) . append ( MthdPostInvokeEntry_Type ) . append ( DataDelimiter ) ; writeDeployedSupportInfo ( s , sbuf , wrapper , null ) ; Tr . debug ( tc , sbuf . toString ( ) ) ; }
|
public class ListDeploymentJobsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ListDeploymentJobsRequest listDeploymentJobsRequest , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( listDeploymentJobsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listDeploymentJobsRequest . getFilters ( ) , FILTERS_BINDING ) ; protocolMarshaller . marshall ( listDeploymentJobsRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; protocolMarshaller . marshall ( listDeploymentJobsRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class ReloadableType { /** * Load a new version of this type , using the specified suffix to tag the newly generated artifact class names .
* @ param versionsuffix the String suffix to append to classnames being created for the reloaded class
* @ param newbytedata the class bytes for the new version of this class
* @ return true if the reload succeeded */
public boolean loadNewVersion ( String versionsuffix , byte [ ] newbytedata ) { } }
|
javaMethodCache = null ; if ( GlobalConfiguration . verboseMode && log . isLoggable ( Level . INFO ) ) { log . info ( "Loading new version of " + slashedtypename + ", identifying suffix " + versionsuffix + ", new data length is " + newbytedata . length + "bytes" ) ; } // If we find our parent classloader has a weavingTransformer
newbytedata = retransform ( newbytedata ) ; // TODO how slow is this ? something to worry about ? make it conditional on a setting ?
boolean reload = true ; TypeDelta td = null ; if ( GlobalConfiguration . verifyReloads ) { td = TypeDiffComputer . computeDifferences ( bytesInitial , newbytedata ) ; if ( td . hasAnythingChanged ( ) ) { // need to check it isn ' t anything we do not yet support
boolean cantReload = false ; StringBuilder s = null ; if ( td . hasTypeDeclarationChanged ( ) ) { // Not allowed to change the type
reload = false ; s = new StringBuilder ( "Spring Loaded: Cannot reload new version of " ) . append ( this . dottedtypename ) . append ( "\n" ) ; if ( td . hasTypeAccessChanged ( ) ) { s . append ( " Reason: Type modifiers changed from=0x" + Integer . toHexString ( td . oAccess ) + " to=0x" + Integer . toHexString ( td . nAccess ) + "\n" ) ; cantReload = true ; } if ( td . hasTypeSupertypeChanged ( ) ) { s . append ( " Reason: Supertype changed from " ) . append ( td . oSuperName ) . append ( " to " ) . append ( td . nSuperName ) . append ( "\n" ) ; cantReload = true ; } if ( td . hasTypeInterfacesChanged ( ) ) { // This next bit of code is to deal with the situation
// Peter saw where on a full build some type implements
// GroovyObject
// but on an incremental build of just that one file , it
// no longer implements it ( presumably - and we could go
// checking
// for this - a supertype already implements the
// interface but the full build wasn ' t smart enough to
// work that out )
boolean justGroovyObjectMoved = false ; if ( ! cantReload && getTypeDescriptor ( ) . isGroovyType ( ) ) { // Is it just GroovyObject that has been lost ?
List < String > interfaceChanges = new ArrayList < String > ( ) ; interfaceChanges . addAll ( td . oInterfaces ) ; interfaceChanges . removeAll ( td . nInterfaces ) ; // If ifaces is just GroovyObject now then that
// means it has been removed from the interface list
// - which can unfortunately happen on an
// incremental compile
if ( this . getTypeDescriptor ( ) . isGroovyType ( ) && interfaceChanges . size ( ) == 1 && interfaceChanges . get ( 0 ) . equals ( "groovy/lang/GroovyObject" ) ) { // just let it go . . . needs fixing in Groovy
// really
justGroovyObjectMoved = true ; s = null ; reload = true ; } } if ( ! justGroovyObjectMoved ) { s . append ( " Reason: Interfaces changed from " ) . append ( td . oInterfaces ) . append ( " to " ) . append ( td . nInterfaces ) . append ( "\n" ) ; cantReload = true ; } } } // if ( td . haveFieldsChangedOrBeenAddedOrRemoved ( ) ) {
// reload = false ;
// if ( s = = null ) {
// s = new StringBuilder ( " Spring - Loaded : Cannot reload new version of " ) . append ( this . dottedtypename ) . append (
// if ( td . hasNewFields ( ) ) {
// s . append ( " Reason : New version has new fields : \ n " + Utils . fieldNodeFormat ( td . getNewFields ( ) . values ( ) ) ) ;
// if ( td . hasLostFields ( ) ) {
// s . append ( " Reason : New version has removed some fields : \ n "
// + Utils . fieldNodeFormat ( td . getLostFields ( ) . values ( ) ) ) ;
boolean somethingCalled = false ; if ( cantReload && td . hasAnythingChanged ( ) ) { somethingCalled = typeRegistry . fireUnableToReloadEvent ( this , td , versionsuffix ) ; } if ( cantReload && s == null && td . hasAnythingChanged ( ) ) { if ( ! somethingCalled ) { System . out . println ( "Something has changed preventing reload" ) ; } } if ( ! somethingCalled && s != null ) { System . out . println ( s ) ; } } } if ( reload ) { TypeRegistry . nothingReloaded = false ; invokersCache_getDeclaredMethods = null ; // will no longer use this cache
if ( GlobalConfiguration . reloadMessages ) { // Only put out the message when running in limit mode ( under tc Server )
System . out . println ( "Reloading: Loading new version of " + this . dottedtypename + " [" + versionsuffix + "]" ) ; } if ( GlobalConfiguration . isRuntimeLogging && log . isLoggable ( Level . INFO ) ) { log . info ( "Reloading: Loading new version of " + this . dottedtypename + " [" + versionsuffix + "]" ) ; } liveVersion = new CurrentLiveVersion ( this , versionsuffix , newbytedata ) ; liveVersion . setTypeDelta ( td ) ; typeRegistry . reloadableTypeDescriptorCache . put ( this . slashedtypename , liveVersion . typeDescriptor ) ; if ( typedescriptor . isGroovyType ( ) ) { fixupGroovyType ( ) ; } if ( typedescriptor . isEnum ( ) ) { resetEnumRelatedState ( ) ; } if ( typeRegistry . shouldRerunStaticInitializer ( this , versionsuffix ) || typedescriptor . isEnum ( ) ) { liveVersion . staticInitializedNeedsRerunningOnDefine = true ; liveVersion . runStaticInitializer ( ) ; } else { liveVersion . staticInitializedNeedsRerunningOnDefine = false ; } // For performance :
// - tag the relevant types that may have been affected by this being reloaded , i . e . this type and any reloadable types in the same hierachy
tagAsAffectedByReload ( ) ; tagSupertypesAsAffectedByReload ( ) ; tagSubtypesAsAffectedByReload ( ) ; typeRegistry . fireReloadEvent ( this , versionsuffix ) ; reloadProxiesIfNecessary ( versionsuffix ) ; } // dump ( newbytedata ) ;
return reload ;
|
public class PropertyUtils { /** * Get all getters of this class , includes inherited methods , but excludes
* static methods . Methods marked as @ JsonIgnore are put to as null .
* @ param clazz
* @ return */
static Map < String , Method > getAllGetters ( Class < ? > clazz ) { } }
|
Map < String , Method > methods = new HashMap < String , Method > ( ) ; while ( ! clazz . equals ( Object . class ) ) { for ( Method m : clazz . getDeclaredMethods ( ) ) { if ( Modifier . isStatic ( m . getModifiers ( ) ) ) { continue ; } String propertyName = getGetterName ( m ) ; if ( shouldIgnore ( m ) ) { methods . put ( propertyName , null ) ; } if ( propertyName != null && ! methods . containsKey ( propertyName ) ) { methods . put ( propertyName , m ) ; } } clazz = clazz . getSuperclass ( ) ; } return methods ;
|
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link AbstractPositionalAccuracyType } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link AbstractPositionalAccuracyType } { @ code > } */
@ XmlElementDecl ( namespace = "http://www.opengis.net/gml" , name = "_positionalAccuracy" ) public JAXBElement < AbstractPositionalAccuracyType > create_PositionalAccuracy ( AbstractPositionalAccuracyType value ) { } }
|
return new JAXBElement < AbstractPositionalAccuracyType > ( __PositionalAccuracy_QNAME , AbstractPositionalAccuracyType . class , null , value ) ;
|
public class EventSubscriptionsInner { /** * Delete an event subscription .
* Delete an existing event subscription .
* @ param scope The scope of the event subscription . The scope can be a subscription , or a resource group , or a top level resource belonging to a resource provider namespace , or an EventGrid topic . For example , use ' / subscriptions / { subscriptionId } / ' for a subscription , ' / subscriptions / { subscriptionId } / resourceGroups / { resourceGroupName } ' for a resource group , and ' / subscriptions / { subscriptionId } / resourceGroups / { resourceGroupName } / providers / { resourceProviderNamespace } / { resourceType } / { resourceName } ' for a resource , and ' / subscriptions / { subscriptionId } / resourceGroups / { resourceGroupName } / providers / Microsoft . EventGrid / topics / { topicName } ' for an EventGrid topic .
* @ param eventSubscriptionName Name of the event subscription
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < Void > beginDeleteAsync ( String scope , String eventSubscriptionName , final ServiceCallback < Void > serviceCallback ) { } }
|
return ServiceFuture . fromResponse ( beginDeleteWithServiceResponseAsync ( scope , eventSubscriptionName ) , serviceCallback ) ;
|
public class Autoboxer { /** * Convert a wrapper class instance to a specified primitive equivalent . */
private void unbox ( Expression expr , PrimitiveType primitiveType ) { } }
|
TypeElement boxedClass = findBoxedSuperclass ( expr . getTypeMirror ( ) ) ; if ( primitiveType == null && boxedClass != null ) { primitiveType = typeUtil . unboxedType ( boxedClass . asType ( ) ) ; } if ( primitiveType == null ) { return ; } ExecutableElement valueMethod = ElementUtil . findMethod ( boxedClass , TypeUtil . getName ( primitiveType ) + VALUE_METHOD ) ; assert valueMethod != null : "could not find value method for " + boxedClass ; MethodInvocation invocation = new MethodInvocation ( new ExecutablePair ( valueMethod ) , null ) ; expr . replaceWith ( invocation ) ; invocation . setExpression ( expr ) ;
|
public class R2RMLParser { /** * method that trims a string of all its double apostrophes from beginning
* and end
* @ param string
* - to be trimmed
* @ return the string without any quotes */
private String trim ( String string ) { } }
|
while ( string . startsWith ( "\"" ) && string . endsWith ( "\"" ) ) { string = string . substring ( 1 , string . length ( ) - 1 ) ; } return string ;
|
public class StreamEx { /** * Creates a new { @ code EntryStream } populated from entries of maps produced
* by supplied mapper function which is applied to the every element of this
* stream .
* This is an < a href = " package - summary . html # StreamOps " > intermediate < / a >
* operation .
* @ param < K > the type of { @ code Map } keys .
* @ param < V > the type of { @ code Map } values .
* @ param mapper a non - interfering , stateless function to apply to each
* element which produces a { @ link Map } of the entries corresponding
* to the single element of the current stream . The mapper function
* may return null or empty { @ code Map } if no mapping should
* correspond to some element .
* @ return the new { @ code EntryStream } */
public < K , V > EntryStream < K , V > flatMapToEntry ( Function < ? super T , ? extends Map < K , V > > mapper ) { } }
|
return new EntryStream < > ( stream ( ) . flatMap ( e -> { Map < K , V > s = mapper . apply ( e ) ; return s == null ? null : s . entrySet ( ) . stream ( ) ; } ) , context ) ;
|
public class EntityManagerFactory { /** * Creates and returns HttpTransportOptions from the given connection parameters .
* @ param parameters
* the connection parameters
* @ return the HttpTransportOptions */
private static HttpTransportOptions getHttpTransportOptions ( ConnectionParameters parameters ) { } }
|
HttpTransportOptions . Builder httpOptionsBuilder = HttpTransportOptions . newBuilder ( ) ; httpOptionsBuilder . setConnectTimeout ( parameters . getConnectionTimeout ( ) ) ; httpOptionsBuilder . setReadTimeout ( parameters . getReadTimeout ( ) ) ; HttpTransportFactory httpTransportFactory = parameters . getHttpTransportFactory ( ) ; if ( httpTransportFactory != null ) { httpOptionsBuilder . setHttpTransportFactory ( httpTransportFactory ) ; } return httpOptionsBuilder . build ( ) ;
|
public class DataEncoder { /** * Encodes the given byte array for use when there is only a single
* nullable property , whose type is a byte array .
* @ param prefixPadding amount of extra bytes to allocate at start of encoded byte array
* @ param suffixPadding amount of extra bytes to allocate at end of encoded byte array */
public static byte [ ] encodeSingleNullable ( byte [ ] value , int prefixPadding , int suffixPadding ) { } }
|
if ( prefixPadding <= 0 && suffixPadding <= 0 ) { if ( value == null ) { return new byte [ ] { NULL_BYTE_HIGH } ; } int length = value . length ; if ( length == 0 ) { return new byte [ ] { NOT_NULL_BYTE_HIGH } ; } byte [ ] dst = new byte [ 1 + length ] ; dst [ 0 ] = NOT_NULL_BYTE_HIGH ; System . arraycopy ( value , 0 , dst , 1 , length ) ; return dst ; } if ( value == null ) { byte [ ] dst = new byte [ prefixPadding + 1 + suffixPadding ] ; dst [ prefixPadding ] = NULL_BYTE_HIGH ; return dst ; } int length = value . length ; byte [ ] dst = new byte [ prefixPadding + 1 + length + suffixPadding ] ; dst [ prefixPadding ] = NOT_NULL_BYTE_HIGH ; System . arraycopy ( value , 0 , dst , prefixPadding + 1 , length ) ; return dst ;
|
public class MatchParserImpl { /** * | Term PlusMinus Expression */
final public Selector Expression ( ) throws ParseException { } }
|
Selector left , right = null ; int op = - 1 ; left = Term ( ) ; switch ( ( jj_ntk == - 1 ) ? jj_ntk ( ) : jj_ntk ) { case 7 : case 8 : op = PlusMinus ( ) ; right = Expression ( ) ; break ; default : jj_la1 [ 5 ] = jj_gen ; ; } if ( right == null ) { if ( true ) return left ; } else { if ( true ) return new OperatorImpl ( op , left , right ) ; } throw new Error ( "Missing return statement in function" ) ;
|
public class AddShoppingCampaignForShowcaseAds { /** * Runs the example .
* @ param adWordsServices the services factory .
* @ param session the session .
* @ param budgetId the budget ID to use for the new campaign .
* @ param merchantId the Merchant Center ID for the new campaign .
* @ throws ApiException if the API request failed with one or more service errors .
* @ throws RemoteException if the API request failed due to other errors .
* @ throws IOException if unable to get media data from the URL . */
public static void runExample ( AdWordsServicesInterface adWordsServices , AdWordsSession session , Long budgetId , Long merchantId ) throws IOException { } }
|
Campaign campaign = createCampaign ( adWordsServices , session , budgetId , merchantId ) ; System . out . printf ( "Campaign with name '%s' and ID %d was added.%n" , campaign . getName ( ) , campaign . getId ( ) ) ; AdGroup adGroup = createAdGroup ( adWordsServices , session , campaign ) ; System . out . printf ( "Ad group with name '%s' and ID %d was added.%n" , adGroup . getName ( ) , adGroup . getId ( ) ) ; AdGroupAd adGroupAd = createShowcaseAd ( adWordsServices , session , adGroup ) ; System . out . printf ( "Showcase ad with ID %d was added.%n" , adGroupAd . getAd ( ) . getId ( ) ) ; ProductPartitionTree partitionTree = createProductPartitions ( adWordsServices , session , adGroup . getId ( ) ) ; System . out . printf ( "Final tree: %s%n" , partitionTree ) ;
|
public class GuideTree { /** * Returns the distance matrix used to construct this guide tree . The scores have been normalized .
* @ return the distance matrix used to construct this guide tree */
public double [ ] [ ] getDistanceMatrix ( ) { } }
|
double [ ] [ ] matrix = new double [ distances . getSize ( ) ] [ distances . getSize ( ) ] ; for ( int i = 0 ; i < matrix . length ; i ++ ) { for ( int j = i + 1 ; j < matrix . length ; j ++ ) { matrix [ i ] [ j ] = matrix [ j ] [ i ] = distances . getValue ( i , j ) ; } } return matrix ;
|
public class StartFaceDetectionRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( StartFaceDetectionRequest startFaceDetectionRequest , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( startFaceDetectionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( startFaceDetectionRequest . getVideo ( ) , VIDEO_BINDING ) ; protocolMarshaller . marshall ( startFaceDetectionRequest . getClientRequestToken ( ) , CLIENTREQUESTTOKEN_BINDING ) ; protocolMarshaller . marshall ( startFaceDetectionRequest . getNotificationChannel ( ) , NOTIFICATIONCHANNEL_BINDING ) ; protocolMarshaller . marshall ( startFaceDetectionRequest . getFaceAttributes ( ) , FACEATTRIBUTES_BINDING ) ; protocolMarshaller . marshall ( startFaceDetectionRequest . getJobTag ( ) , JOBTAG_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class DataSerializer { /** * Get component type of a ( multidimensional ) array or any other object .
* @ param object Object ( e . g . a multidimensional array ) .
* @ return Component type ( e . g . int , Boolean . class , String . class , double ,
* etc . ) . */
public static final Class < ? > getComponentType ( Object object ) { } }
|
Class < ? > result = object . getClass ( ) . getComponentType ( ) ; while ( result . isArray ( ) ) { result = result . getComponentType ( ) ; } return result ;
|
public class Spider { /** * Filters the seed list using the current fetch filters , preventing any non - valid seed from being accessed .
* @ see # seedList
* @ see FetchFilter
* @ see SpiderController # getFetchFilters ( )
* @ since 2.5.0 */
private void fetchFilterSeeds ( ) { } }
|
if ( seedList == null || seedList . isEmpty ( ) ) { return ; } for ( Iterator < URI > it = seedList . iterator ( ) ; it . hasNext ( ) ; ) { URI seed = it . next ( ) ; for ( FetchFilter filter : controller . getFetchFilters ( ) ) { FetchStatus filterReason = filter . checkFilter ( seed ) ; if ( filterReason != FetchStatus . VALID ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "Seed: " + seed + " was filtered with reason: " + filterReason ) ; } it . remove ( ) ; break ; } } }
|
public class RollupInterval { /** * Calculates the number of intervals in a given span for the rollup
* interval and makes sure we have table names . It also sets the table byte
* arrays .
* @ return The number of intervals in the span
* @ throws IllegalArgumentException if milliseconds were passed in the interval
* or the interval couldn ' t be parsed , the tables are missing , or if the
* duration is too large , too large for the span or the interval is too
* large or small for the span or if the span is invalid .
* @ throws NullPointerException if the interval is empty or null */
void validateAndCompile ( ) { } }
|
if ( temporal_table_name == null || temporal_table_name . isEmpty ( ) ) { throw new IllegalArgumentException ( "The rollup table cannot be null or empty" ) ; } temporal_table = temporal_table_name . getBytes ( Const . ASCII_CHARSET ) ; if ( groupby_table_name == null || groupby_table_name . isEmpty ( ) ) { throw new IllegalArgumentException ( "The pre-aggregate rollup table cannot" + " be null or empty" ) ; } groupby_table = groupby_table_name . getBytes ( Const . ASCII_CHARSET ) ; if ( units != 'h' && unit_multiplier > 1 ) { throw new IllegalArgumentException ( "Multipliers are only usable with the 'h' unit" ) ; } else if ( units == 'h' && unit_multiplier > 1 && unit_multiplier % 2 != 0 ) { throw new IllegalArgumentException ( "The multiplier must be 1 or an even value" ) ; } interval = ( int ) ( DateTime . parseDuration ( string_interval ) / 1000 ) ; if ( interval < 1 ) { throw new IllegalArgumentException ( "Millisecond intervals are not supported" ) ; } if ( interval >= Integer . MAX_VALUE ) { throw new IllegalArgumentException ( "Interval is too big: " + interval ) ; } // The line above will validate for us
interval_units = string_interval . charAt ( string_interval . length ( ) - 1 ) ; int num_span = 0 ; switch ( units ) { case 'h' : num_span = MAX_SECONDS_IN_HOUR ; break ; case 'd' : num_span = MAX_SECONDS_IN_DAY ; break ; case 'n' : num_span = MAX_SECONDS_IN_MONTH ; break ; case 'y' : num_span = MAX_SECONDS_IN_YEAR ; break ; default : throw new IllegalArgumentException ( "Unrecogznied span '" + units + "'" ) ; } num_span *= unit_multiplier ; if ( interval >= num_span ) { throw new IllegalArgumentException ( "Interval [" + interval + "] is too large for the span [" + units + "]" ) ; } intervals = num_span / ( int ) interval ; if ( intervals > MAX_INTERVALS ) { throw new IllegalArgumentException ( "Too many intervals [" + intervals + "] in the span. Must be smaller than [" + MAX_INTERVALS + "] to fit in 14 bits" ) ; } if ( intervals < MIN_INTERVALS ) { throw new IllegalArgumentException ( "Not enough intervals [" + intervals + "] for the span. Must be at least [" + MIN_INTERVALS + "]" ) ; }
|
public class AstNodeFactory { /** * Sets the mixin type property for an { @ link AstNode }
* @ param node the node to set the property on ; may not be null
* @ param type the mixin type { @ link String } ; may not be null */
public void setType ( AstNode node , String type ) { } }
|
CheckArg . isNotNull ( node , "node" ) ; CheckArg . isNotNull ( type , "parent" ) ; node . setProperty ( JCR_MIXIN_TYPES , type ) ;
|
public class AWSCognitoIdentityProviderClient { /** * Returns a unique generated shared secret key code for the user account . The request takes an access token or a
* session string , but not both .
* @ param associateSoftwareTokenRequest
* @ return Result of the AssociateSoftwareToken operation returned by the service .
* @ throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter .
* @ throws NotAuthorizedException
* This exception is thrown when a user is not authorized .
* @ throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service cannot find the requested resource .
* @ throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error .
* @ throws SoftwareTokenMFANotFoundException
* This exception is thrown when the software token TOTP multi - factor authentication ( MFA ) is not enabled
* for the user pool .
* @ sample AWSCognitoIdentityProvider . AssociateSoftwareToken
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / cognito - idp - 2016-04-18 / AssociateSoftwareToken "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public AssociateSoftwareTokenResult associateSoftwareToken ( AssociateSoftwareTokenRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeAssociateSoftwareToken ( request ) ;
|
public class KinesisProxy { /** * { @ inheritDoc } */
@ Override public GetRecordsResult getRecords ( String shardIterator , int maxRecordsToGet ) throws InterruptedException { } }
|
final GetRecordsRequest getRecordsRequest = new GetRecordsRequest ( ) ; getRecordsRequest . setShardIterator ( shardIterator ) ; getRecordsRequest . setLimit ( maxRecordsToGet ) ; GetRecordsResult getRecordsResult = null ; int retryCount = 0 ; while ( retryCount <= getRecordsMaxRetries && getRecordsResult == null ) { try { getRecordsResult = kinesisClient . getRecords ( getRecordsRequest ) ; } catch ( SdkClientException ex ) { if ( isRecoverableSdkClientException ( ex ) ) { long backoffMillis = fullJitterBackoff ( getRecordsBaseBackoffMillis , getRecordsMaxBackoffMillis , getRecordsExpConstant , retryCount ++ ) ; LOG . warn ( "Got recoverable SdkClientException. Backing off for " + backoffMillis + " millis (" + ex . getClass ( ) . getName ( ) + ": " + ex . getMessage ( ) + ")" ) ; Thread . sleep ( backoffMillis ) ; } else { throw ex ; } } } if ( getRecordsResult == null ) { throw new RuntimeException ( "Retries exceeded for getRecords operation - all " + getRecordsMaxRetries + " retry attempts failed." ) ; } return getRecordsResult ;
|
public class WebsocketSession { /** * Method to send normal response .
* @ param response response
* @ return mono void */
public Mono < Void > send ( GatewayMessage response ) { } }
|
return Mono . defer ( ( ) -> outbound . sendObject ( Mono . just ( response ) . map ( codec :: encode ) . map ( TextWebSocketFrame :: new ) ) . then ( ) . doOnSuccessOrError ( ( avoid , th ) -> logSend ( response , th ) ) ) ;
|
public class AggregateResourceIdentifierMarshaller { /** * Marshall the given parameter object . */
public void marshall ( AggregateResourceIdentifier aggregateResourceIdentifier , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( aggregateResourceIdentifier == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( aggregateResourceIdentifier . getSourceAccountId ( ) , SOURCEACCOUNTID_BINDING ) ; protocolMarshaller . marshall ( aggregateResourceIdentifier . getSourceRegion ( ) , SOURCEREGION_BINDING ) ; protocolMarshaller . marshall ( aggregateResourceIdentifier . getResourceId ( ) , RESOURCEID_BINDING ) ; protocolMarshaller . marshall ( aggregateResourceIdentifier . getResourceType ( ) , RESOURCETYPE_BINDING ) ; protocolMarshaller . marshall ( aggregateResourceIdentifier . getResourceName ( ) , RESOURCENAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class Vectors { /** * Copies all of the values from one { @ code Vector } into another . After the
* operation , all of the values in { @ code dest } will be the same as that of
* { @ code source } . The legnth of { @ code dest } must be as long as the length
* of { @ code source } . Once completed { @ code dest } is returned .
* @ param dest The { @ code Vector } to copy values into .
* @ param source The { @ code Vector } to copy values from .
* @ return { @ code dest } after being copied from { @ code source } .
* @ throws IllegalArgumentException if the length of { @ code dest } is less
* than that of { @ code source } . */
public static Vector copy ( Vector dest , Vector source ) { } }
|
for ( int i = 0 ; i < source . length ( ) ; ++ i ) dest . set ( i , source . getValue ( i ) . doubleValue ( ) ) ; return dest ;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.