signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class AmazonGlacierClient { /** * This operation initiates a multipart upload . Amazon Glacier creates a multipart upload resource and returns its
* ID in the response . The multipart upload ID is used in subsequent requests to upload parts of an archive ( see
* < a > UploadMultipartPart < / a > ) .
* When you initiate a multipart upload , you specify the part size in number of bytes . The part size must be a
* megabyte ( 1024 KB ) multiplied by a power of 2 - for example , 1048576 ( 1 MB ) , 2097152 ( 2 MB ) , 4194304 ( 4 MB ) ,
* 8388608 ( 8 MB ) , and so on . The minimum allowable part size is 1 MB , and the maximum is 4 GB .
* Every part you upload to this resource ( see < a > UploadMultipartPart < / a > ) , except the last one , must have the same
* size . The last one can be the same size or smaller . For example , suppose you want to upload a 16.2 MB file . If
* you initiate the multipart upload with a part size of 4 MB , you will upload four parts of 4 MB each and one part
* of 0.2 MB .
* < note >
* You don ' t need to know the size of the archive when you start a multipart upload because Amazon Glacier does not
* require you to specify the overall archive size .
* < / note >
* After you complete the multipart upload , Amazon Glacier removes the multipart upload resource referenced by the
* ID . Amazon Glacier also removes the multipart upload resource if you cancel the multipart upload or it may be
* removed if there is no activity for a period of 24 hours .
* An AWS account has full permission to perform all operations ( actions ) . However , AWS Identity and Access
* Management ( IAM ) users don ' t have any permissions by default . You must grant them explicit permission to perform
* specific actions . For more information , see < a
* href = " http : / / docs . aws . amazon . com / amazonglacier / latest / dev / using - iam - with - amazon - glacier . html " > Access Control
* Using AWS Identity and Access Management ( IAM ) < / a > .
* For conceptual information and underlying REST API , see < a
* href = " http : / / docs . aws . amazon . com / amazonglacier / latest / dev / uploading - archive - mpu . html " > Uploading Large Archives in
* Parts ( Multipart Upload ) < / a > and < a
* href = " http : / / docs . aws . amazon . com / amazonglacier / latest / dev / api - multipart - initiate - upload . html " > Initiate Multipart
* Upload < / a > in the < i > Amazon Glacier Developer Guide < / i > .
* @ param initiateMultipartUploadRequest
* Provides options for initiating a multipart upload to an Amazon Glacier vault .
* @ return Result of the InitiateMultipartUpload operation returned by the service .
* @ throws ResourceNotFoundException
* Returned if the specified resource ( such as a vault , upload ID , or job ID ) doesn ' t exist .
* @ throws InvalidParameterValueException
* Returned if a parameter of the request is incorrectly specified .
* @ throws MissingParameterValueException
* Returned if a required header or parameter is missing from the request .
* @ throws ServiceUnavailableException
* Returned if the service cannot complete the request .
* @ sample AmazonGlacier . InitiateMultipartUpload */
@ Override public InitiateMultipartUploadResult initiateMultipartUpload ( InitiateMultipartUploadRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeInitiateMultipartUpload ( request ) ; |
public class Batch { /** * / * ( non - Javadoc )
* @ see com . googlecode . batchfb . Batcher # paged ( java . lang . String , java . lang . Class , com . googlecode . batchfb . Param [ ] ) */
@ Override public < T > PagedLater < T > paged ( String object , Class < T > type , Param ... params ) { } } | if ( ! object . contains ( "/" ) ) throw new IllegalArgumentException ( "You can only use paged() for connection requests, eg me/friends" ) ; // For example if type is User . class , this will produce Paged < User >
JavaType pagedType = mapper . getTypeFactory ( ) . constructParametricType ( Paged . class , mapper . getTypeFactory ( ) . constructType ( type ) ) ; GraphRequest < Paged < T > > req = this . graph ( object , pagedType , params ) ; return new PagedLaterAdapter < T > ( this . master , req , type ) ; |
public class SingleInstanceHealth { /** * Represents the causes , which provide more information about the current health status .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setCauses ( java . util . Collection ) } or { @ link # withCauses ( java . util . Collection ) } if you want to override the
* existing values .
* @ param causes
* Represents the causes , which provide more information about the current health status .
* @ return Returns a reference to this object so that method calls can be chained together . */
public SingleInstanceHealth withCauses ( String ... causes ) { } } | if ( this . causes == null ) { setCauses ( new com . amazonaws . internal . SdkInternalList < String > ( causes . length ) ) ; } for ( String ele : causes ) { this . causes . add ( ele ) ; } return this ; |
public class DatePicker { /** * zInternalSetDateTextField , This is called whenever we need to programmatically change the
* date text field . The purpose of this function is to make sure that text field change events
* only occur once per programmatic text change , instead of occurring twice . The default
* behavior is that the text change event will fire twice . ( By default , it changes once to clear
* the text , and changes once to change it to new text . ) */
private void zInternalSetDateTextField ( String text ) { } } | skipTextFieldChangedFunctionWhileTrue = true ; dateTextField . setText ( text ) ; skipTextFieldChangedFunctionWhileTrue = false ; zEventTextFieldChanged ( ) ; |
public class MoreStringUtil { /** * 判断字符串是否以字母开头
* 如果字符串为Null或空 , 返回false */
public static boolean startWith ( @ Nullable CharSequence s , char c ) { } } | if ( StringUtils . isEmpty ( s ) ) { return false ; } return s . charAt ( 0 ) == c ; |
public class SingleDbJDBCConnection { /** * { @ inheritDoc } */
@ Override protected int updatePropertyByIdentifier ( int version , int type , String cid ) throws SQLException , InvalidItemStateException , RepositoryException { } } | if ( updateProperty == null ) { updateProperty = dbConnection . prepareStatement ( UPDATE_PROPERTY ) ; } else { updateProperty . clearParameters ( ) ; } updateProperty . setInt ( 1 , version ) ; updateProperty . setInt ( 2 , type ) ; updateProperty . setString ( 3 , cid ) ; return executeUpdate ( updateProperty , TYPE_UPDATE_PROPERTY ) ; |
public class dnssoarec { /** * Use this API to add dnssoarec resources . */
public static base_responses add ( nitro_service client , dnssoarec resources [ ] ) throws Exception { } } | base_responses result = null ; if ( resources != null && resources . length > 0 ) { dnssoarec addresources [ ] = new dnssoarec [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { addresources [ i ] = new dnssoarec ( ) ; addresources [ i ] . domain = resources [ i ] . domain ; addresources [ i ] . originserver = resources [ i ] . originserver ; addresources [ i ] . contact = resources [ i ] . contact ; addresources [ i ] . serial = resources [ i ] . serial ; addresources [ i ] . refresh = resources [ i ] . refresh ; addresources [ i ] . retry = resources [ i ] . retry ; addresources [ i ] . expire = resources [ i ] . expire ; addresources [ i ] . minimum = resources [ i ] . minimum ; addresources [ i ] . ttl = resources [ i ] . ttl ; } result = add_bulk_request ( client , addresources ) ; } return result ; |
public class TcpListener { /** * ( non - Javadoc )
* @ see net . timewalker . ffmq4 . utils . concurrent . SynchronizableThread # run ( ) */
@ Override public void run ( ) { } } | try { log . debug ( "Waiting for clients [" + getName ( ) + "]" ) ; while ( ! stopRequired ) { Socket clientSocket = serverSocket . accept ( ) ; // Enforce listener capacity
int activeClients = getActiveClients ( ) ; if ( activeClients >= listenerCapacity ) { log . warn ( "Listener is full (max=" + listenerCapacity + "), dropping new connection attempt." ) ; try { clientSocket . close ( ) ; } catch ( Exception e ) { log . error ( "Cannot close incoming connection" , e ) ; } continue ; } String clientId = UUIDProvider . getInstance ( ) . getShortUUID ( ) ; log . debug ( "Accepting a new client from " + clientSocket . getInetAddress ( ) . getHostAddress ( ) + " (" + ( activeClients + 1 ) + ") : " + clientId + " [" + getName ( ) + "]" ) ; try { ClientProcessor processor = createProcessor ( clientId , clientSocket ) ; registerClient ( processor ) ; processor . start ( ) ; } catch ( Exception e ) { try { clientSocket . close ( ) ; } catch ( Exception ex ) { log . error ( "Could not close socket [" + getName ( ) + "]" , ex ) ; } log . error ( "Client failed : " + clientId + " [" + getName ( ) + "]" , e ) ; } } } catch ( Exception e ) { if ( ! stopRequired ) log . fatal ( "Server failed [" + getName ( ) + "]" , e ) ; } |
public class ElCalculator { /** * 运用运算符ASCII码 - 40做索引的运算符优先级 */
public Object eval ( String expression ) { } } | expression = transform ( expression ) ; Object result = calculate ( expression ) ; return result ; |
public class Base { /** * Supports iterating the children elements in some generic processor or browser
* All defined children will be listed , even if they have no value on this instance
* Note that the actual content of primitive or xhtml elements is not iterated explicitly .
* To find these , the processing code must recognise the element as a primitive , typecast
* the value to a { @ link Type } , and examine the value
* @ return a list of all the children defined for this element */
public List < Property > children ( ) { } } | List < Property > result = new ArrayList < Property > ( ) ; listChildren ( result ) ; return result ; |
public class A6Record { /** * Converts rdata to a String */
String rrToString ( ) { } } | StringBuffer sb = new StringBuffer ( ) ; sb . append ( prefixBits ) ; if ( suffix != null ) { sb . append ( " " ) ; sb . append ( suffix . getHostAddress ( ) ) ; } if ( prefix != null ) { sb . append ( " " ) ; sb . append ( prefix ) ; } return sb . toString ( ) ; |
public class LObjDblConsumerBuilder { /** * One of ways of creating builder . This is possibly the least verbose way where compiler should be able to guess the generic parameters . */
@ Nonnull public static < T > LObjDblConsumer < T > objDblConsumerFrom ( Consumer < LObjDblConsumerBuilder < T > > buildingFunction ) { } } | LObjDblConsumerBuilder builder = new LObjDblConsumerBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ; |
public class CouchbaseLiteHttpClientFactory { /** * This is a convenience method to allow couchbase lite to connect to servers
* that use self - signed SSL certs .
* * DO NOT USE THIS IN PRODUCTION *
* For more information , see :
* https : / / github . com / couchbase / couchbase - lite - java - core / pull / 9 */
@ InterfaceAudience . Public public void allowSelfSignedSSLCertificates ( ) { } } | // SSLSocketFactory that bypasses certificate verification .
try { setSSLSocketFactory ( selfSignedSSLSocketFactory ( ) ) ; } catch ( GeneralSecurityException e ) { throw new RuntimeException ( e ) ; } // HostnameVerifier that bypasses hotname verification
setHostnameVerifier ( ignoreHostnameVerifier ( ) ) ; |
public class BDAImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setData ( byte [ ] newData ) { } } | byte [ ] oldData = data ; data = newData ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . BDA__DATA , oldData , data ) ) ; |
public class DummyMemcachedSessionService { /** * Store the provided session in memcached if the session was modified
* or if the session needs to be relocated .
* @ param session
* the session to save
* @ param sessionRelocationRequired
* specifies , if the session id was changed due to a memcached failover or tomcat failover .
* @ return the { @ link BackupResultStatus } */
public Future < BackupResult > backupSession ( final String sessionId , final boolean sessionIdChanged , final String requestId ) { } } | final MemcachedBackupSession session = _manager . getSessionInternal ( sessionId ) ; if ( session == null ) { if ( _log . isDebugEnabled ( ) ) _log . debug ( "No session found in session map for " + sessionId ) ; return new SimpleFuture < BackupResult > ( BackupResult . SKIPPED ) ; } _log . info ( "Serializing session data for session " + session . getIdInternal ( ) ) ; final long startSerialization = System . currentTimeMillis ( ) ; final byte [ ] data = _transcoderService . serializeAttributes ( ( MemcachedBackupSession ) session , ( ( MemcachedBackupSession ) session ) . getAttributesFiltered ( ) ) ; _log . info ( String . format ( "Serializing %1$,.3f kb session data for session %2$s took %3$d ms." , ( double ) data . length / 1000 , session . getIdInternal ( ) , System . currentTimeMillis ( ) - startSerialization ) ) ; _sessionData . put ( session . getIdInternal ( ) , data ) ; _statistics . registerSince ( ATTRIBUTES_SERIALIZATION , startSerialization ) ; _statistics . register ( CACHED_DATA_SIZE , data . length ) ; return new SimpleFuture < BackupResult > ( new BackupResult ( BackupResultStatus . SUCCESS ) ) ; |
public class NaaccrXmlUtils { /** * Returns the NAACCR format of the given XML file .
* @ param xmlFile provided data file
* @ return the NAACCR format , null if it cannot be determined */
public static String getFormatFromXmlFile ( File xmlFile ) { } } | if ( xmlFile == null || ! xmlFile . exists ( ) ) return null ; try ( Reader reader = createReader ( xmlFile ) ) { return getFormatFromXmlReader ( reader ) ; } catch ( IOException | RuntimeException e ) { return null ; } |
public class Face { /** * Gets the i - th half - edge associated with the face .
* @ param i
* the half - edge index , in the range 0-2.
* @ return the half - edge */
public HalfEdge getEdge ( int i ) { } } | HalfEdge he = he0 ; while ( i > 0 ) { he = he . next ; i -- ; } while ( i < 0 ) { he = he . prev ; i ++ ; } return he ; |
public class PropertyBuilder { /** * Build the signature .
* @ param node the XML element that specifies which components to document
* @ param propertyDocTree the content tree to which the documentation will be added */
public void buildSignature ( XMLNode node , Content propertyDocTree ) { } } | propertyDocTree . addContent ( writer . getSignature ( currentProperty ) ) ; |
public class SpatialiteWKBReader { /** * Reads a { @ link Geometry } in binary WKB format from an { @ link InStream } .
* @ param is the stream to read from
* @ return the Geometry read
* @ throws IOException if the underlying stream creates an error
* @ throws ParseException if the WKB is ill - formed */
public Geometry read ( InStream is ) throws IOException , ParseException { } } | dis . setInStream ( is ) ; Geometry g = readSpatialiteGeometry ( ) ; return g ; |
public class AbstractAmazonSQSAsync { /** * Simplified method form for invoking the RemovePermission operation .
* @ see # removePermissionAsync ( RemovePermissionRequest ) */
@ Override public java . util . concurrent . Future < RemovePermissionResult > removePermissionAsync ( String queueUrl , String label ) { } } | return removePermissionAsync ( new RemovePermissionRequest ( ) . withQueueUrl ( queueUrl ) . withLabel ( label ) ) ; |
public class RegexMatchSet { /** * Contains an array of < a > RegexMatchTuple < / a > objects . Each < code > RegexMatchTuple < / code > object contains :
* < ul >
* < li >
* The part of a web request that you want AWS WAF to inspect , such as a query string or the value of the
* < code > User - Agent < / code > header .
* < / li >
* < li >
* The identifier of the pattern ( a regular expression ) that you want AWS WAF to look for . For more information , see
* < a > RegexPatternSet < / a > .
* < / li >
* < li >
* Whether to perform any conversions on the request , such as converting it to lowercase , before inspecting it for
* the specified string .
* < / li >
* < / ul >
* @ param regexMatchTuples
* Contains an array of < a > RegexMatchTuple < / a > objects . Each < code > RegexMatchTuple < / code > object contains :
* < ul >
* < li >
* The part of a web request that you want AWS WAF to inspect , such as a query string or the value of the
* < code > User - Agent < / code > header .
* < / li >
* < li >
* The identifier of the pattern ( a regular expression ) that you want AWS WAF to look for . For more
* information , see < a > RegexPatternSet < / a > .
* < / li >
* < li >
* Whether to perform any conversions on the request , such as converting it to lowercase , before inspecting
* it for the specified string .
* < / li > */
public void setRegexMatchTuples ( java . util . Collection < RegexMatchTuple > regexMatchTuples ) { } } | if ( regexMatchTuples == null ) { this . regexMatchTuples = null ; return ; } this . regexMatchTuples = new java . util . ArrayList < RegexMatchTuple > ( regexMatchTuples ) ; |
public class CmsPatternPanelMonthlyController { /** * Set the week day the event should take place .
* @ param dayString the day as string . */
public void setWeekDay ( String dayString ) { } } | final WeekDay day = WeekDay . valueOf ( dayString ) ; if ( m_model . getWeekDay ( ) != day ) { removeExceptionsOnChange ( new Command ( ) { public void execute ( ) { m_model . setWeekDay ( day ) ; onValueChange ( ) ; } } ) ; } |
public class UserAccountHelper { /** * Returns the collection of attributes that the specified currentUser can edit .
* @ param currentUser
* @ return */
public List < Preference > getEditableUserAttributes ( IPerson currentUser ) { } } | EntityIdentifier ei = currentUser . getEntityIdentifier ( ) ; IAuthorizationPrincipal ap = AuthorizationServiceFacade . instance ( ) . newPrincipal ( ei . getKey ( ) , ei . getType ( ) ) ; List < Preference > allowedAttributes = new ArrayList < Preference > ( ) ; for ( Preference attr : accountEditAttributes ) { if ( ap . hasPermission ( "UP_USERS" , "EDIT_USER_ATTRIBUTE" , attr . getName ( ) ) ) { allowedAttributes . add ( attr ) ; } } return allowedAttributes ; |
public class BasicTagList { /** * Returns a tag list containing the union of { @ code t1 } and { @ code t2 } .
* If there is a conflict with tag keys , the tag from { @ code t2 } will be
* used . */
public static BasicTagList concat ( TagList t1 , Tag ... t2 ) { } } | return new BasicTagList ( Iterables . concat ( t1 , Arrays . asList ( t2 ) ) ) ; |
public class InternalXtypeParser { /** * InternalXtype . g : 769:1 : ruleQualifiedName returns [ AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken ( ) ] : ( this _ ValidID _ 0 = ruleValidID ( kw = ' . ' this _ ValidID _ 2 = ruleValidID ) * ) ; */
public final AntlrDatatypeRuleToken ruleQualifiedName ( ) throws RecognitionException { } } | AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken ( ) ; Token kw = null ; AntlrDatatypeRuleToken this_ValidID_0 = null ; AntlrDatatypeRuleToken this_ValidID_2 = null ; enterRule ( ) ; try { // InternalXtype . g : 775:2 : ( ( this _ ValidID _ 0 = ruleValidID ( kw = ' . ' this _ ValidID _ 2 = ruleValidID ) * ) )
// InternalXtype . g : 776:2 : ( this _ ValidID _ 0 = ruleValidID ( kw = ' . ' this _ ValidID _ 2 = ruleValidID ) * )
{ // InternalXtype . g : 776:2 : ( this _ ValidID _ 0 = ruleValidID ( kw = ' . ' this _ ValidID _ 2 = ruleValidID ) * )
// InternalXtype . g : 777:3 : this _ ValidID _ 0 = ruleValidID ( kw = ' . ' this _ ValidID _ 2 = ruleValidID ) *
{ if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getQualifiedNameAccess ( ) . getValidIDParserRuleCall_0 ( ) ) ; } pushFollow ( FOLLOW_12 ) ; this_ValidID_0 = ruleValidID ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( this_ValidID_0 ) ; } if ( state . backtracking == 0 ) { afterParserOrEnumRuleCall ( ) ; } // InternalXtype . g : 787:3 : ( kw = ' . ' this _ ValidID _ 2 = ruleValidID ) *
loop15 : do { int alt15 = 2 ; int LA15_0 = input . LA ( 1 ) ; if ( ( LA15_0 == 18 ) ) { int LA15_2 = input . LA ( 2 ) ; if ( ( LA15_2 == RULE_ID ) ) { alt15 = 1 ; } } switch ( alt15 ) { case 1 : // InternalXtype . g : 788:4 : kw = ' . ' this _ ValidID _ 2 = ruleValidID
{ kw = ( Token ) match ( input , 18 , FOLLOW_13 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getQualifiedNameAccess ( ) . getFullStopKeyword_1_0 ( ) ) ; } if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getQualifiedNameAccess ( ) . getValidIDParserRuleCall_1_1 ( ) ) ; } pushFollow ( FOLLOW_12 ) ; this_ValidID_2 = ruleValidID ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( this_ValidID_2 ) ; } if ( state . backtracking == 0 ) { afterParserOrEnumRuleCall ( ) ; } } break ; default : break loop15 ; } } while ( true ) ; } } if ( state . backtracking == 0 ) { leaveRule ( ) ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ; |
public class DefaultWhenFileSystem { /** * Truncate the file represented by { @ code path } to length { @ code len } in bytes , asynchronously .
* The operation will fail if the file does not exist or { @ code len } is less than { @ code zero } .
* @ param path the path to the file
* @ param len the length to truncate it to
* @ return a promise for completion */
@ Override public Promise < Void > truncate ( String path , long len ) { } } | return adapter . toPromise ( handler -> vertx . fileSystem ( ) . truncate ( path , len , handler ) ) ; |
public class ActionResult { /** * Sets the result value of the action .
* @ param actionId the new action id
* @ param resultValue the new result value of the action */
public void setResultValue ( String actionId , Object resultValue ) { } } | if ( actionId == null || ! actionId . contains ( ActivityContext . ID_SEPARATOR ) ) { this . actionId = actionId ; this . resultValue = resultValue ; } else { String [ ] ids = StringUtils . tokenize ( actionId , ActivityContext . ID_SEPARATOR , true ) ; if ( ids . length == 1 ) { this . actionId = null ; this . resultValue = resultValue ; } else if ( ids . length == 2 ) { ResultValueMap resultValueMap = new ResultValueMap ( ) ; resultValueMap . put ( ids [ 1 ] , resultValue ) ; this . actionId = ids [ 0 ] ; this . resultValue = resultValueMap ; } else { ResultValueMap resultValueMap = new ResultValueMap ( ) ; for ( int i = 1 ; i < ids . length - 1 ; i ++ ) { ResultValueMap resultValueMap2 = new ResultValueMap ( ) ; resultValueMap . put ( ids [ i ] , resultValueMap2 ) ; resultValueMap = resultValueMap2 ; } resultValueMap . put ( ids [ ids . length - 1 ] , resultValue ) ; this . actionId = actionId ; this . resultValue = resultValueMap ; } } |
public class UnicodeFormatter { /** * 字符串转换为int , 避免运行时异常
* @ param str 待处理字符串
* @ param defaultVal 默认值
* @ return 转换失败返回指定默认值 */
private static int toInt ( String str , int defaultVal ) { } } | try { return Integer . parseInt ( str . trim ( ) ) ; } catch ( Exception e ) { return defaultVal ; } |
public class CliFrontend { /** * Builds command line options for the info action .
* @ return Command line options for the info action . */
static Options getInfoOptions ( Options options ) { } } | options = getProgramSpecificOptions ( options ) ; options = getJobManagerAddressOption ( options ) ; options . addOption ( DESCR_OPTION ) ; options . addOption ( PLAN_OPTION ) ; return options ; |
public class ALPNHackClientHelloExplorer { /** * enum {
* hello _ request ( 0 ) , client _ hello ( 1 ) , server _ hello ( 2 ) ,
* certificate ( 11 ) , server _ key _ exchange ( 12 ) ,
* certificate _ request ( 13 ) , server _ hello _ done ( 14 ) ,
* certificate _ verify ( 15 ) , client _ key _ exchange ( 16 ) ,
* finished ( 20)
* ( 255)
* } HandshakeType ;
* struct {
* HandshakeType msg _ type ;
* uint24 length ;
* select ( HandshakeType ) {
* case hello _ request : HelloRequest ;
* case client _ hello : ClientHello ;
* case server _ hello : ServerHello ;
* case certificate : Certificate ;
* case server _ key _ exchange : ServerKeyExchange ;
* case certificate _ request : CertificateRequest ;
* case server _ hello _ done : ServerHelloDone ;
* case certificate _ verify : CertificateVerify ;
* case client _ key _ exchange : ClientKeyExchange ;
* case finished : Finished ;
* } body ;
* } Handshake ; */
private static void exploreHandshake ( ByteBuffer input , byte recordMajorVersion , byte recordMinorVersion , int recordLength , List < String > alpnProtocols , ByteArrayOutputStream out ) throws SSLException { } } | // What is the handshake type ?
byte handshakeType = input . get ( ) ; if ( handshakeType != 0x01 ) { // 0x01 : client _ hello message
throw new SSLException ( "Expected client hello" ) ; } if ( out != null ) { out . write ( handshakeType & 0xFF ) ; } // What is the handshake body length ?
int handshakeLength = getInt24 ( input ) ; if ( out != null ) { // placeholder
out . write ( 0 ) ; out . write ( 0 ) ; out . write ( 0 ) ; } // Theoretically , a single handshake message might span multiple
// records , but in practice this does not occur .
if ( handshakeLength > recordLength - 4 ) { // 4 : handshake header size
throw new SSLException ( "Multi record handshake" ) ; } input = input . duplicate ( ) ; input . limit ( handshakeLength + input . position ( ) ) ; exploreClientHello ( input , alpnProtocols , out ) ; |
public class Entry { /** * Unsynchronized . Get the next entry in the list .
* @ return the next entry in the list */
public Entry getNext ( ) { } } | checkEntryParent ( ) ; Entry entry = null ; if ( ! isLast ( ) ) { entry = next ; } return entry ; |
public class DictionaryMembership { /** * Gets the value of the keyEntityPair property .
* This accessor method returns a reference to the live list ,
* not a snapshot . Therefore any modification you make to the
* returned list will be present inside the JAXB object .
* This is why there is not a < CODE > set < / CODE > method for the keyEntityPair property .
* For example , to add a new item , do as follows :
* < pre >
* getKeyEntityPair ( ) . add ( newItem ) ;
* < / pre >
* Objects of the following type ( s ) are allowed in the list
* { @ link org . openprovenance . prov . sql . Entry } */
@ Transient public List < org . openprovenance . prov . model . Entry > getKeyEntityPair ( ) { } } | if ( keyEntityPair == null ) { keyEntityPair = new ArrayList < org . openprovenance . prov . model . Entry > ( ) ; } return this . keyEntityPair ; |
public class FactoryBackgroundModel { /** * Creates an instance of { @ link BackgroundStationaryGmm } .
* @ param config Configures the background model
* @ param imageType Type of input image
* @ return new instance of the background model */
public static < T extends ImageBase < T > > BackgroundStationaryGmm < T > stationaryGmm ( @ Nullable ConfigBackgroundGmm config , ImageType < T > imageType ) { } } | if ( config == null ) config = new ConfigBackgroundGmm ( ) ; else config . checkValidity ( ) ; BackgroundStationaryGmm < T > ret ; switch ( imageType . getFamily ( ) ) { case GRAY : ret = new BackgroundStationaryGmm_SB ( config . learningPeriod , config . decayCoefient , config . numberOfGaussian , imageType ) ; break ; case PLANAR : case INTERLEAVED : ret = new BackgroundStationaryGmm_MB ( config . learningPeriod , config . decayCoefient , config . numberOfGaussian , imageType ) ; break ; default : throw new IllegalArgumentException ( "Unknown image type" ) ; } ret . setInitialVariance ( config . initialVariance ) ; ret . setMaxDistance ( config . maxDistance ) ; ret . setSignificantWeight ( config . significantWeight ) ; ret . setUnknownValue ( config . unknownValue ) ; return ret ; |
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public String convertIfcLayerSetDirectionEnumToString ( EDataType eDataType , Object instanceValue ) { } } | return instanceValue == null ? null : instanceValue . toString ( ) ; |
public class FullDemo { /** * setTwoWithY2KButtonClicked , This sets the date in date picker two , to New Years Day 2000. */
private static void setTwoWithY2KButtonClicked ( ActionEvent e ) { } } | // Set date picker date .
LocalDate dateY2K = LocalDate . of ( 2000 , Month . JANUARY , 1 ) ; datePicker2 . setDate ( dateY2K ) ; // Display message .
String dateString = datePicker2 . getDateStringOrSuppliedString ( "(null)" ) ; String message = "The datePicker2 date was set to New Years 2000!\n\n" ; message += ( "The datePicker2 date is currently set to: " + dateString + "." ) ; panel . messageTextArea . setText ( message ) ; |
public class PTD1Impl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setXPEXTENT ( Integer newXPEXTENT ) { } } | Integer oldXPEXTENT = xpextent ; xpextent = newXPEXTENT ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . PTD1__XPEXTENT , oldXPEXTENT , xpextent ) ) ; |
public class CacheAwareHistoryEventProducer { /** * find a cached entity by primary key */
protected < T extends HistoryEvent > T findInCache ( Class < T > type , String id ) { } } | return Context . getCommandContext ( ) . getDbEntityManager ( ) . getCachedEntity ( type , id ) ; |
public class UnicodeDecompressor { /** * Decompress a byte array into a Unicode character array .
* @ param buffer The byte array to decompress .
* @ param start The start of the byte run to decompress .
* @ param limit The limit of the byte run to decompress .
* @ return A character array containing the decompressed bytes .
* @ see # decompress ( byte [ ] ) */
public static char [ ] decompress ( byte [ ] buffer , int start , int limit ) { } } | UnicodeDecompressor comp = new UnicodeDecompressor ( ) ; // use a buffer we know will never overflow
// in the worst case , each byte will decompress
// to a surrogate pair ( buffer must be at least 2 chars )
int len = Math . max ( 2 , 2 * ( limit - start ) ) ; char [ ] temp = new char [ len ] ; int charCount = comp . decompress ( buffer , start , limit , null , temp , 0 , len ) ; char [ ] result = new char [ charCount ] ; System . arraycopy ( temp , 0 , result , 0 , charCount ) ; return result ; |
public class UnsafeOperations { /** * Puts the value at the given offset of the supplied parent object
* @ param parent The Object ' s parent
* @ param offset The offset
* @ param value char to be put */
public final void putChar ( Object parent , long offset , char value ) { } } | THE_UNSAFE . putChar ( parent , offset , value ) ; |
public class VaultDriverBase { /** * Creates a stub method for an abstract method , typically a createXXX
* method . */
@ Override public < V > MethodVault < V > newMethod ( Class < ? > type , String methodName , Class < ? > [ ] paramTypes ) { } } | Objects . requireNonNull ( type ) ; MethodVault < V > method = newMethodRec ( type , methodName , paramTypes ) ; if ( method != null ) { return method ; } throw new IllegalStateException ( L . l ( "Unknown method {0}.{1} {2}" , type . getSimpleName ( ) , methodName , Arrays . asList ( paramTypes ) ) ) ; |
public class CheckConverter { /** * Init this converter .
* @ param converter The target converter to set to this string .
* @ param strTargetValue The string to set the converter to is set to true .
* @ param fldTargetValue The string to set this field if set to true .
* @ param strAltFieldDesc An alternate description to display .
* @ param bTrueIfMatch If true , set to the alternate value .
* @ param boolMaskValue */
public void init ( Converter converter , String strTargetValue , BaseField fldTargetValue , String strAltFieldDesc , boolean bTrueIfMatch , Boolean boolMaskValue ) { } } | m_fldTargetValue = fldTargetValue ; m_strTargetValue = strTargetValue ; m_bTrueIfMatch = bTrueIfMatch ; if ( boolMaskValue != null ) m_boolMaskValue = boolMaskValue ; else { if ( ( converter != null ) && ( converter . getField ( ) instanceof StringField ) ) m_boolMaskValue = Boolean . TRUE ; // String - default to true ( mask )
else m_boolMaskValue = Boolean . FALSE ; // Other - default to false ( value = target )
} super . init ( converter , strAltFieldDesc , null ) ; |
public class Manager { /** * Releases all resources used by the Manager instance and closes all its databases . */
@ InterfaceAudience . Public public void close ( ) { } } | synchronized ( lockDatabases ) { Log . d ( Database . TAG , "Closing " + this ) ; // Close all database :
// Snapshot of the current open database to avoid concurrent modification as
// the database will be forgotten ( removed from the databases map ) when it is closed :
Database [ ] openDbs = databases . values ( ) . toArray ( new Database [ databases . size ( ) ] ) ; for ( Database database : openDbs ) database . close ( ) ; databases . clear ( ) ; // Stop reachability :
context . getNetworkReachabilityManager ( ) . stopListening ( ) ; // Shutdown ScheduledExecutorService :
if ( workExecutor != null && ! workExecutor . isShutdown ( ) ) Utils . shutdownAndAwaitTermination ( workExecutor ) ; Log . d ( Database . TAG , "Closed " + this ) ; } |
public class CasEmbeddedContainerUtils { /** * Gets cas banner instance .
* @ return the cas banner instance */
public static Banner getCasBannerInstance ( ) { } } | val packageName = CasEmbeddedContainerUtils . class . getPackage ( ) . getName ( ) ; val reflections = new Reflections ( new ConfigurationBuilder ( ) . filterInputsBy ( new FilterBuilder ( ) . includePackage ( packageName ) ) . setUrls ( ClasspathHelper . forPackage ( packageName ) ) . setScanners ( new SubTypesScanner ( true ) ) ) ; val subTypes = reflections . getSubTypesOf ( AbstractCasBanner . class ) ; subTypes . remove ( DefaultCasBanner . class ) ; if ( subTypes . isEmpty ( ) ) { return new DefaultCasBanner ( ) ; } try { val clz = subTypes . iterator ( ) . next ( ) ; return clz . getDeclaredConstructor ( ) . newInstance ( ) ; } catch ( final Exception e ) { LOGGER . error ( e . getMessage ( ) , e ) ; } return new DefaultCasBanner ( ) ; |
public class PdfDocument { /** * Implements a link to another document .
* @ param filename the filename for the remote document
* @ param page the page to jump to
* @ param llx the lower left x corner of the activation area
* @ param lly the lower left y corner of the activation area
* @ param urx the upper right x corner of the activation area
* @ param ury the upper right y corner of the activation area */
void remoteGoto ( String filename , int page , float llx , float lly , float urx , float ury ) { } } | addAnnotation ( new PdfAnnotation ( writer , llx , lly , urx , ury , new PdfAction ( filename , page ) ) ) ; |
public class Encoding { /** * Percent decode a { @ link CharSequence } .
* @ param s Percent encoded { @ link CharSequence } .
* @ return Decoded CharSequence or null if invalid encoding . */
static CharSequence decode ( final CharSequence s ) { } } | if ( ! contains ( s , '%' ) ) { return s . toString ( ) ; } return decode0 ( s ) ; |
public class AmazonLightsailClient { /** * Deletes the known host key or certificate used by the Amazon Lightsail browser - based SSH or RDP clients to
* authenticate an instance . This operation enables the Lightsail browser - based SSH or RDP clients to connect to the
* instance after a host key mismatch .
* < important >
* Perform this operation only if you were expecting the host key or certificate mismatch or if you are familiar
* with the new host key or certificate on the instance . For more information , see < a href =
* " https : / / lightsail . aws . amazon . com / ls / docs / en / articles / amazon - lightsail - troubleshooting - browser - based - ssh - rdp - client - connection "
* > Troubleshooting connection issues when using the Amazon Lightsail browser - based SSH or RDP client < / a > .
* < / important >
* @ param deleteKnownHostKeysRequest
* @ return Result of the DeleteKnownHostKeys operation returned by the service .
* @ throws ServiceException
* A general service exception .
* @ throws InvalidInputException
* Lightsail throws this exception when user input does not conform to the validation rules of an input
* field . < / p > < note >
* Domain - related APIs are only available in the N . Virginia ( us - east - 1 ) Region . Please set your AWS Region
* configuration to us - east - 1 to create , view , or edit these resources .
* @ throws NotFoundException
* Lightsail throws this exception when it cannot find a resource .
* @ throws OperationFailureException
* Lightsail throws this exception when an operation fails to execute .
* @ throws AccessDeniedException
* Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to
* access a resource .
* @ throws AccountSetupInProgressException
* Lightsail throws this exception when an account is still in the setup in progress state .
* @ throws UnauthenticatedException
* Lightsail throws this exception when the user has not been authenticated .
* @ sample AmazonLightsail . DeleteKnownHostKeys
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / lightsail - 2016-11-28 / DeleteKnownHostKeys " target = " _ top " > AWS
* API Documentation < / a > */
@ Override public DeleteKnownHostKeysResult deleteKnownHostKeys ( DeleteKnownHostKeysRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeDeleteKnownHostKeys ( request ) ; |
public class Stream { /** * Sets a metadata property about the stream . Note that { @ code Stream } wrappers obtained
* through intermediate operations don ' t have their own properties , but instead access the
* metadata properties of the source { @ code Stream } .
* @ param name
* the name of the property
* @ param value
* the value of the property , null to clear it
* @ return this { @ code Stream } , for call chaining */
public final Stream < T > setProperty ( final String name , @ Nullable final Object value ) { } } | Preconditions . checkNotNull ( name ) ; synchronized ( this . state ) { if ( this . state . properties != null ) { this . state . properties . put ( name , value ) ; } else if ( value != null ) { this . state . properties = Maps . newHashMap ( ) ; this . state . properties . put ( name , value ) ; } } return this ; |
public class PoolBase { /** * Check whether Connection . isValid ( ) is supported , or that the user has test query configured .
* @ param connection a Connection to check
* @ throws SQLException rethrown from the driver */
private void checkValidationSupport ( final Connection connection ) throws SQLException { } } | try { if ( isUseJdbc4Validation ) { connection . isValid ( 1 ) ; } else { executeSql ( connection , config . getConnectionTestQuery ( ) , false ) ; } } catch ( Exception | AbstractMethodError e ) { logger . error ( "{} - Failed to execute{} connection test query ({})." , poolName , ( isUseJdbc4Validation ? " isValid() for connection, configure" : "" ) , e . getMessage ( ) ) ; throw e ; } |
public class BdbPersistentStoreFactory { /** * Creates an environment config that allows object creation and supports
* transactions . In addition , it automatically calculates a cache size
* based on available memory .
* @ return a newly created environment config instance . */
@ Override protected EnvironmentConfig createEnvConfig ( ) { } } | EnvironmentConfig envConf = new EnvironmentConfig ( ) ; envConf . setAllowCreate ( true ) ; envConf . setTransactional ( true ) ; LOGGER . log ( Level . FINE , "Calculating cache size" ) ; MemoryMXBean memoryMXBean = ManagementFactory . getMemoryMXBean ( ) ; MemoryUsage memoryUsage = memoryMXBean . getHeapMemoryUsage ( ) ; long max = memoryUsage . getMax ( ) ; long used = memoryUsage . getUsed ( ) ; long available = max - used ; long cacheSize = Math . round ( available / 6.0 ) ; envConf . setCacheSize ( cacheSize ) ; LOGGER . log ( Level . FINE , "Cache size set to {0}" , cacheSize ) ; return envConf ; |
public class HBasePanel { /** * Print the top nav menu .
* @ param out The html out stream .
* @ param reg The resources object .
* @ exception DBException File exception . */
public void printHtmlLogo ( PrintWriter out , ResourceBundle reg ) throws DBException { } } | char chMenubar = HBasePanel . getFirstToUpper ( this . getProperty ( DBParams . LOGOS ) , 'H' ) ; if ( chMenubar == 'H' ) if ( ( ( BasePanel ) this . getScreenField ( ) ) . isMainMenu ( ) ) chMenubar = 'Y' ; if ( chMenubar == 'Y' ) { String strNav = reg . getString ( "htmlLogo" ) ; strNav = Utility . replaceResources ( strNav , reg , null , null ) ; String strScreen = ( ( BasePanel ) this . getScreenField ( ) ) . getScreenURL ( ) ; strScreen = Utility . encodeXML ( strScreen ) ; String strUserName = ( ( MainApplication ) this . getTask ( ) . getApplication ( ) ) . getUserName ( ) ; if ( Utility . isNumeric ( strUserName ) ) strUserName = DBConstants . BLANK ; String strLanguage = this . getTask ( ) . getApplication ( ) . getLanguage ( false ) ; strNav = Utility . replace ( strNav , HtmlConstants . URL_TAG , strScreen ) ; strNav = Utility . replace ( strNav , HtmlConstants . USER_NAME_TAG , strUserName ) ; strNav = Utility . replace ( strNav , "<language/>" , strLanguage ) ; this . writeHtmlString ( strNav , out ) ; } |
public class Channels { /** * Constructs a channel that reads bytes from the given stream .
* < p > The resulting channel will not be buffered ; it will simply redirect
* its I / O operations to the given stream . Closing the channel will in
* turn cause the stream to be closed . < / p >
* @ param in
* The stream from which bytes are to be read
* @ return A new readable byte channel */
public static ReadableByteChannel newChannel ( final InputStream in ) { } } | checkNotNull ( in , "in" ) ; if ( in instanceof FileInputStream && FileInputStream . class . equals ( in . getClass ( ) ) ) { return ( ( FileInputStream ) in ) . getChannel ( ) ; } return new ReadableByteChannelImpl ( in ) ; |
public class URLTemplate { /** * Replace a single token in the template with a corresponding int value .
* Tokens are expected to be qualified in braces . E . g . { url : port } */
public void substitute ( String token , int value ) { } } | String valueStr = Integer . toString ( value ) ; _tokenValuesMap . put ( token , valueStr ) ; |
public class MimeTypes { /** * Makes an educated guess of the mime type of the resource pointed by this url .
* It tries to extract an ' extension ' part and confronts this extension to the list of known extensions .
* @ param url the url
* @ return the mime type , BINARY if not found . */
public static String getMimeTypeForFile ( URL url ) { } } | if ( url == null ) { // The input url is null so we can ' t retrieve a mimetype , therefore we return null .
return null ; } String external = url . toExternalForm ( ) ; if ( external . indexOf ( '.' ) == - 1 ) { return BINARY ; } else { String ext = external . substring ( external . lastIndexOf ( '.' ) + 1 ) ; String mime = KnownMimeTypes . getMimeTypeByExtension ( ext ) ; if ( mime == null ) { return BINARY ; } else { return mime ; } } |
public class TransformersLogger { /** * Get a warning message for the given operation at the provided address for the passed attributes
* with a default message appended . Intended for use in providing a failure description for an operation
* or an exception message for an { @ link org . jboss . as . controller . OperationFailedException } .
* The default appended message is ' Attributes are not understood in the target model version and this resource
* will need to be ignored on the target host . '
* @ param address where warning occurred
* @ param operation where which problem occurred
* @ param attributes attributes we that have problems about */
public String getAttributeWarning ( PathAddress address , ModelNode operation , String ... attributes ) { } } | return getAttributeWarning ( address , operation , null , attributes ) ; |
public class RawResponse { /** * Write response body to OutputStream . OutputStream will not be closed . */
public void writeTo ( OutputStream out ) { } } | try { InputStreams . transferTo ( body ( ) , out ) ; } catch ( IOException e ) { throw new RequestsException ( e ) ; } finally { close ( ) ; } |
public class ScryptKDFParams { /** * Get an instance from an ASN . 1 object .
* @ param obj an ASN . 1 object .
* @ return an instance . */
public static ScryptKDFParams getInstance ( Object obj ) { } } | if ( obj instanceof ScryptKDFParams ) { return ( ScryptKDFParams ) obj ; } if ( obj != null ) { return new ScryptKDFParams ( ASN1Sequence . getInstance ( obj ) ) ; } return null ; |
public class ULocale { /** * < strong > [ icu ] < / strong > Converts the specified keyword value ( BCP 47 Unicode locale extension type ,
* or legacy type or type alias ) to the canonical legacy type . For example ,
* the legacy type " phonebook " is returned for the input BCP 47 Unicode
* locale extension type " phonebk " with the keyword " collation " ( or " co " ) .
* When the specified keyword is not recognized , but the specified value
* satisfies the syntax of legacy key , or when the specified keyword
* allows ' variable ' type and the specified value satisfies the syntax ,
* the lower - case version of the input value will be returned .
* For example ,
* < code > toLegacyType ( " Foo " , " Bar " ) < / code > returns " bar " ,
* < code > toLegacyType ( " vt " , " 00A4 " ) < / code > returns " 00a4 " .
* @ param keyword the locale keyword ( either legacy keyword such as
* " collation " or BCP 47 Unicode locale extension
* key such as " co " ) .
* @ param value the locale keyword value ( either BCP 47 Unicode locale
* extension type such as " phonebk " or legacy keyword value
* such as " phonebook " ) .
* @ return the well - formed legacy type , or null if the specified
* keyword value cannot be mapped to a well - formed legacy
* type .
* @ see # toUnicodeLocaleType ( String , String ) */
public static String toLegacyType ( String keyword , String value ) { } } | String legacyType = KeyTypeData . toLegacyType ( keyword , value , null , null ) ; if ( legacyType == null ) { // Checks if the specified locale type is well - formed with the legacy locale syntax .
// Note :
// Neither ICU nor LDML / CLDR provides the definition of keyword syntax .
// However , a type should not contain ' = ' obviously . For now , all existing
// types are using ASCII alphabetic letters with a few symbol letters . We won ' t
// add any new type that is not compatible with the BCP 47 syntax except timezone
// IDs . For now , we assume a valid type start with [ 0-9a - zA - Z ] , but may contain
// ' - ' ' _ ' ' / ' in the middle .
if ( value . matches ( "[0-9a-zA-Z]+([_/\\-][0-9a-zA-Z]+)*" ) ) { legacyType = AsciiUtil . toLowerString ( value ) ; } } return legacyType ; |
public class AsyncUpdateThread { /** * end class ExecutionThread . . . */
public void alarm ( Object thandle ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "alarm" , new Object [ ] { this , mp . getMessagingEngineUuid ( ) } ) ; synchronized ( this ) { if ( ! closed ) { if ( ( executeSinceExpiry ) || executing ) { // has committed recently
executeSinceExpiry = false ; } else { // has not committed recently
try { if ( enqueuedUnits . size ( ) > 0 ) startExecutingUpdates ( ) ; } catch ( ClosedException e ) { // No FFDC code needed
// do nothing as error already logged by startExecutingUpdates
} } } } // end synchronized ( this )
if ( maxCommitInterval > 0 ) { mp . getAlarmManager ( ) . create ( maxCommitInterval , this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "alarm" ) ; |
public class JMonthChooser { /** * Sets the month . This is a bound property . Valuse are valid between 0
* ( January ) and 11 ( December ) . A value < 0 will be treated as 0 , a value >
* 11 will be treated as 11.
* @ param newMonth
* the new month value
* @ see # getMonth */
public void setMonth ( int newMonth ) { } } | if ( newMonth < 0 || newMonth == Integer . MIN_VALUE ) { setMonth ( 0 , true ) ; } else if ( newMonth > 11 ) { setMonth ( 11 , true ) ; } else { setMonth ( newMonth , true ) ; } |
public class CapabilityRegistry { /** * ImmutableCapabilityRegistry methods */
@ Override public boolean hasCapability ( String capabilityName , CapabilityScope scope ) { } } | readLock . lock ( ) ; try { return findSatisfactoryCapability ( capabilityName , scope , ! forServer ) != null ; } finally { readLock . unlock ( ) ; } |
public class Transform { /** * Creates a URIResolver that returns a SAXSource .
* @ param resolver
* @ return */
public static URIResolver createSAXURIResolver ( Resolver resolver ) { } } | final SAXResolver saxResolver = new SAXResolver ( resolver ) ; return new URIResolver ( ) { public Source resolve ( String href , String base ) throws TransformerException { try { return saxResolver . resolve ( href , base ) ; } catch ( SAXException e ) { throw toTransformerException ( e ) ; } catch ( IOException e ) { throw new TransformerException ( e ) ; } } } ; |
public class DwgBlockHeader { /** * Read a Block header in the DWG format Version 15
* @ param data Array of unsigned bytes obtained from the DWG binary file
* @ param offset The current bit offset where the value begins
* @ throws Exception If an unexpected bit value is found in the DWG file . Occurs
* when we are looking for LwPolylines . */
public void readDwgBlockHeaderV15 ( int [ ] data , int offset ) throws Exception { } } | int bitPos = offset ; Vector v = DwgUtil . getBitLong ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; int numReactors = ( ( Integer ) v . get ( 1 ) ) . intValue ( ) ; setNumReactors ( numReactors ) ; v = DwgUtil . getTextString ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; String name = ( String ) v . get ( 1 ) ; this . name = name ; v = DwgUtil . testBit ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; boolean flag = ( ( Boolean ) v . get ( 1 ) ) . booleanValue ( ) ; flag64 = flag ; v = DwgUtil . getBitShort ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; int xrefplus1 = ( ( Integer ) v . get ( 1 ) ) . intValue ( ) ; xRefPlus = xrefplus1 ; v = DwgUtil . testBit ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; boolean xdep = ( ( Boolean ) v . get ( 1 ) ) . booleanValue ( ) ; this . xdep = xdep ; v = DwgUtil . testBit ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; boolean anon = ( ( Boolean ) v . get ( 1 ) ) . booleanValue ( ) ; anonymous = anon ; v = DwgUtil . testBit ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; boolean hasatts = ( ( Boolean ) v . get ( 1 ) ) . booleanValue ( ) ; hasAttrs = hasatts ; v = DwgUtil . testBit ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; boolean bxref = ( ( Boolean ) v . get ( 1 ) ) . booleanValue ( ) ; blkIsXRef = bxref ; v = DwgUtil . testBit ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; boolean xover = ( ( Boolean ) v . get ( 1 ) ) . booleanValue ( ) ; xRefOverLaid = xover ; v = DwgUtil . testBit ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; boolean loaded = ( ( Boolean ) v . get ( 1 ) ) . booleanValue ( ) ; this . loaded = loaded ; v = DwgUtil . getBitDouble ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; double bx = ( ( Double ) v . get ( 1 ) ) . doubleValue ( ) ; v = DwgUtil . getBitDouble ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; double by = ( ( Double ) v . get ( 1 ) ) . doubleValue ( ) ; v = DwgUtil . getBitDouble ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; double bz = ( ( Double ) v . get ( 1 ) ) . doubleValue ( ) ; double [ ] coord = new double [ ] { bx , by , bz } ; basePoint = coord ; v = DwgUtil . getTextString ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; String pname = ( String ) v . get ( 1 ) ; xRefPName = pname ; int icount = 0 ; while ( true ) { v = DwgUtil . getRawChar ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; int val = ( ( Integer ) v . get ( 1 ) ) . intValue ( ) ; if ( val == 0 ) { break ; } icount ++ ; } v = DwgUtil . getTextString ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; String desc = ( String ) v . get ( 1 ) ; blockDescription = desc ; v = DwgUtil . getBitLong ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; int pdsize = ( ( Integer ) v . get ( 1 ) ) . intValue ( ) ; if ( pdsize > 0 ) { int count = pdsize + icount ; // int pdata = ( ( Integer ) DwgUtil . getBits ( data , count , bitPos ) ) . intValue ( ) ;
// previewData = pdata ;
bitPos = bitPos + count ; } v = DwgUtil . getHandle ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; int [ ] handle = new int [ v . size ( ) - 1 ] ; for ( int j = 1 ; j < v . size ( ) ; j ++ ) { handle [ j - 1 ] = ( ( Integer ) v . get ( j ) ) . intValue ( ) ; } Vector handleVect = new Vector ( ) ; for ( int i = 0 ; i < handle . length ; i ++ ) { handleVect . add ( new Integer ( handle [ i ] ) ) ; } blockControlHandle = DwgUtil . handleBinToHandleInt ( handleVect ) ; for ( int i = 0 ; i < numReactors ; i ++ ) { v = DwgUtil . getHandle ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; handle = new int [ v . size ( ) - 1 ] ; for ( int j = 1 ; j < v . size ( ) ; j ++ ) { handle [ j - 1 ] = ( ( Integer ) v . get ( j ) ) . intValue ( ) ; } } v = DwgUtil . getHandle ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; handle = new int [ v . size ( ) - 1 ] ; for ( int j = 1 ; j < v . size ( ) ; j ++ ) { handle [ j - 1 ] = ( ( Integer ) v . get ( j ) ) . intValue ( ) ; } v = DwgUtil . getHandle ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; handle = new int [ v . size ( ) - 1 ] ; for ( int j = 1 ; j < v . size ( ) ; j ++ ) { handle [ j - 1 ] = ( ( Integer ) v . get ( j ) ) . intValue ( ) ; } handleVect = new Vector ( ) ; for ( int i = 0 ; i < handle . length ; i ++ ) { handleVect . add ( new Integer ( handle [ i ] ) ) ; } nullHandle = DwgUtil . handleBinToHandleInt ( handleVect ) ; v = DwgUtil . getHandle ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; handle = new int [ v . size ( ) - 1 ] ; for ( int j = 1 ; j < v . size ( ) ; j ++ ) { handle [ j - 1 ] = ( ( Integer ) v . get ( j ) ) . intValue ( ) ; } handleVect = new Vector ( ) ; for ( int i = 0 ; i < handle . length ; i ++ ) { handleVect . add ( new Integer ( handle [ i ] ) ) ; } blockEntityHandle = DwgUtil . handleBinToHandleInt ( handleVect ) ; if ( ( ! bxref ) && ( ! xover ) ) { v = DwgUtil . getHandle ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; handle = new int [ v . size ( ) - 1 ] ; for ( int j = 1 ; j < v . size ( ) ; j ++ ) { handle [ j - 1 ] = ( ( Integer ) v . get ( j ) ) . intValue ( ) ; } handleVect = new Vector ( ) ; for ( int i = 0 ; i < handle . length ; i ++ ) { handleVect . add ( new Integer ( handle [ i ] ) ) ; } firstEntityHandle = DwgUtil . handleBinToHandleInt ( handleVect ) ; v = DwgUtil . getHandle ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; handle = new int [ v . size ( ) - 1 ] ; for ( int j = 1 ; j < v . size ( ) ; j ++ ) { handle [ j - 1 ] = ( ( Integer ) v . get ( j ) ) . intValue ( ) ; } handleVect = new Vector ( ) ; for ( int i = 0 ; i < handle . length ; i ++ ) { handleVect . add ( new Integer ( handle [ i ] ) ) ; } lastEntityHandle = DwgUtil . handleBinToHandleInt ( handleVect ) ; } v = DwgUtil . getHandle ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; handle = new int [ v . size ( ) - 1 ] ; for ( int j = 1 ; j < v . size ( ) ; j ++ ) { handle [ j - 1 ] = ( ( Integer ) v . get ( j ) ) . intValue ( ) ; } handleVect = new Vector ( ) ; for ( int i = 0 ; i < handle . length ; i ++ ) { handleVect . add ( new Integer ( handle [ i ] ) ) ; } endBlkEntityHandle = DwgUtil . handleBinToHandleInt ( handleVect ) ; if ( icount > 0 ) { Vector handles = new Vector ( ) ; for ( int i = 0 ; i < icount ; i ++ ) { v = DwgUtil . getHandle ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; handle = new int [ v . size ( ) - 1 ] ; for ( int j = 1 ; j < v . size ( ) ; j ++ ) { handle [ j - 1 ] = ( ( Integer ) v . get ( j ) ) . intValue ( ) ; } handles . add ( handle ) ; } insertHandles = handles ; } v = DwgUtil . getHandle ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; handle = new int [ v . size ( ) - 1 ] ; for ( int j = 1 ; j < v . size ( ) ; j ++ ) { handle [ j - 1 ] = ( ( Integer ) v . get ( j ) ) . intValue ( ) ; } handleVect = new Vector ( ) ; for ( int i = 0 ; i < handle . length ; i ++ ) { handleVect . add ( new Integer ( handle [ i ] ) ) ; } layoutHandle = DwgUtil . handleBinToHandleInt ( handleVect ) ; |
public class EBCImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public boolean eIsSet ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . EBC__BCDO_NAME : return BCDO_NAME_EDEFAULT == null ? bCdoName != null : ! BCDO_NAME_EDEFAULT . equals ( bCdoName ) ; case AfplibPackage . EBC__TRIPLETS : return triplets != null && ! triplets . isEmpty ( ) ; } return super . eIsSet ( featureID ) ; |
public class EntityHelper { /** * 获取查询的Select
* @ param entityClass
* @ return */
public static String getSelectColumns ( Class < ? > entityClass ) { } } | EntityTable entityTable = getEntityTable ( entityClass ) ; if ( entityTable . getBaseSelect ( ) != null ) { return entityTable . getBaseSelect ( ) ; } Set < EntityColumn > columnList = getColumns ( entityClass ) ; StringBuilder selectBuilder = new StringBuilder ( ) ; boolean skipAlias = Map . class . isAssignableFrom ( entityClass ) ; for ( EntityColumn entityColumn : columnList ) { selectBuilder . append ( entityColumn . getColumn ( ) ) ; if ( ! skipAlias && ! entityColumn . getColumn ( ) . equalsIgnoreCase ( entityColumn . getProperty ( ) ) ) { // 不等的时候分几种情况 , 例如 ` DESC `
if ( entityColumn . getColumn ( ) . substring ( 1 , entityColumn . getColumn ( ) . length ( ) - 1 ) . equalsIgnoreCase ( entityColumn . getProperty ( ) ) ) { selectBuilder . append ( "," ) ; } else { selectBuilder . append ( " AS " ) . append ( entityColumn . getProperty ( ) ) . append ( "," ) ; } } else { selectBuilder . append ( "," ) ; } } entityTable . setBaseSelect ( selectBuilder . substring ( 0 , selectBuilder . length ( ) - 1 ) ) ; return entityTable . getBaseSelect ( ) ; |
public class ImplicitObjects { /** * Creates the Map that maps init parameter name to single init
* parameter value . */
public static Map createInitParamMap ( PageContext pContext ) { } } | final ServletContext context = pContext . getServletContext ( ) ; return new EnumeratedMap ( ) { public Enumeration enumerateKeys ( ) { return context . getInitParameterNames ( ) ; } public Object getValue ( Object pKey ) { if ( pKey instanceof String ) { return context . getInitParameter ( ( String ) pKey ) ; } else { return null ; } } public boolean isMutable ( ) { return false ; } } ; |
public class ProjectNodeSupport { /** * Return a list of resource model configuration
* @ param props properties
* @ return List of Maps , each map containing " type " : String , " props " : Properties */
public static List < Map < String , Object > > listResourceModelConfigurations ( final Properties props ) { } } | final ArrayList < Map < String , Object > > list = new ArrayList < > ( ) ; int i = 1 ; boolean done = false ; while ( ! done ) { final String prefix = RESOURCES_SOURCE_PROP_PREFIX + "." + i ; if ( props . containsKey ( prefix + ".type" ) ) { final String providerType = props . getProperty ( prefix + ".type" ) ; final Properties configProps = new Properties ( ) ; final int len = ( prefix + ".config." ) . length ( ) ; for ( final Object o : props . keySet ( ) ) { final String key = ( String ) o ; if ( key . startsWith ( prefix + ".config." ) ) { configProps . setProperty ( key . substring ( len ) , props . getProperty ( key ) ) ; } } final HashMap < String , Object > map = new HashMap < > ( ) ; map . put ( "type" , providerType ) ; map . put ( "props" , configProps ) ; list . add ( map ) ; } else { done = true ; } i ++ ; } return list ; |
public class DescribeSubnetsRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional
* parameters to enable operation dry - run . */
@ Override public Request < DescribeSubnetsRequest > getDryRunRequest ( ) { } } | Request < DescribeSubnetsRequest > request = new DescribeSubnetsRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ; |
public class XSynchronizedExpressionImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eSet ( int featureID , Object newValue ) { } } | switch ( featureID ) { case XbasePackage . XSYNCHRONIZED_EXPRESSION__PARAM : setParam ( ( XExpression ) newValue ) ; return ; case XbasePackage . XSYNCHRONIZED_EXPRESSION__EXPRESSION : setExpression ( ( XExpression ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ; |
public class RecordingGroupMarshaller { /** * Marshall the given parameter object . */
public void marshall ( RecordingGroup recordingGroup , ProtocolMarshaller protocolMarshaller ) { } } | if ( recordingGroup == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( recordingGroup . getAllSupported ( ) , ALLSUPPORTED_BINDING ) ; protocolMarshaller . marshall ( recordingGroup . getIncludeGlobalResourceTypes ( ) , INCLUDEGLOBALRESOURCETYPES_BINDING ) ; protocolMarshaller . marshall ( recordingGroup . getResourceTypes ( ) , RESOURCETYPES_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class SymmPackEVD { /** * Computes the eigenvalue decomposition of the given matrix
* @ param A
* Matrix to factorize . Overwritten on return
* @ return The current eigenvalue decomposition
* @ throws NotConvergedException */
public SymmPackEVD factor ( LowerSymmPackMatrix A ) throws NotConvergedException { } } | if ( uplo != UpLo . Lower ) throw new IllegalArgumentException ( "Eigenvalue computer configured for lower-symmetrical matrices" ) ; return factor ( A , A . getData ( ) ) ; |
public class RemoteInputChannel { /** * Releases all exclusive and floating buffers , closes the partition request client . */
@ Override void releaseAllResources ( ) throws IOException { } } | if ( isReleased . compareAndSet ( false , true ) ) { // Gather all exclusive buffers and recycle them to global pool in batch , because
// we do not want to trigger redistribution of buffers after each recycle .
final List < MemorySegment > exclusiveRecyclingSegments = new ArrayList < > ( ) ; synchronized ( receivedBuffers ) { Buffer buffer ; while ( ( buffer = receivedBuffers . poll ( ) ) != null ) { if ( buffer . getRecycler ( ) == this ) { exclusiveRecyclingSegments . add ( buffer . getMemorySegment ( ) ) ; } else { buffer . recycleBuffer ( ) ; } } } synchronized ( bufferQueue ) { bufferQueue . releaseAll ( exclusiveRecyclingSegments ) ; } if ( exclusiveRecyclingSegments . size ( ) > 0 ) { inputGate . returnExclusiveSegments ( exclusiveRecyclingSegments ) ; } // The released flag has to be set before closing the connection to ensure that
// buffers received concurrently with closing are properly recycled .
if ( partitionRequestClient != null ) { partitionRequestClient . close ( this ) ; } else { connectionManager . closeOpenChannelConnections ( connectionId ) ; } } |
public class MQLinkQueuedMessage { /** * / * ( non - Javadoc )
* @ see com . ibm . ws . sib . processor . runtime . SIMPMQLinkTransmitMessageControllable # getTargetQueue ( ) */
public String getTargetQueue ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getTargetQueue" ) ; SibTr . exit ( tc , "getTargetQueue" , targetQueue ) ; } return targetQueue ; |
public class VariableDeclaration { /** * Sets the node type and returns this node .
* @ throws IllegalArgumentException if { @ code declType } is invalid */
@ Override public org . mozilla . javascript . Node setType ( int type ) { } } | if ( type != Token . VAR && type != Token . CONST && type != Token . LET ) throw new IllegalArgumentException ( "invalid decl type: " + type ) ; return super . setType ( type ) ; |
public class StateSpoutSpec { /** * Returns true if field corresponding to fieldID is set ( has been assigned a value ) and false otherwise */
public boolean isSet ( _Fields field ) { } } | if ( field == null ) { throw new IllegalArgumentException ( ) ; } switch ( field ) { case STATE_SPOUT_OBJECT : return is_set_state_spout_object ( ) ; case COMMON : return is_set_common ( ) ; } throw new IllegalStateException ( ) ; |
public class Solver { /** * Maximizes a univariate function using a grid search followed by Brent ' s algorithm .
* @ param fn the likelihood function to minimize
* @ param gridStart the lower bound for the grid search
* @ param gridEnd the upper bound for the grid search
* @ param gridStep step size for the grid search
* @ param relErr relative error tolerance for Brent ' s algorithm
* @ param absErr absolute error tolerance for Brent ' s algorithm
* @ param maxIter maximum # of iterations to perform in Brent ' s algorithm
* @ param maxEval maximum # of Likelihood function evaluations in Brent ' s algorithm
* @ return the value of the parameter that maximizes the function */
public static double maximize ( UnivariateFunction fn , double gridStart , double gridEnd , double gridStep , double relErr , double absErr , int maxIter , int maxEval ) { } } | Interval interval = gridSearch ( fn , gridStart , gridEnd , gridStep ) ; BrentOptimizer bo = new BrentOptimizer ( relErr , absErr ) ; UnivariatePointValuePair max = bo . optimize ( new MaxIter ( maxIter ) , new MaxEval ( maxEval ) , new SearchInterval ( interval . getInf ( ) , interval . getSup ( ) ) , new UnivariateObjectiveFunction ( fn ) , GoalType . MAXIMIZE ) ; return max . getPoint ( ) ; |
public class NewUserDialog { /** * This method is called from within the constructor to
* initialize the form . */
private void initComponents ( String initialMessage , String initialUsername , LoginDialog loginDialog ) { } } | this . loginDialog = loginDialog ; java . awt . GridBagConstraints gridBagConstraints ; getContentPane ( ) . setLayout ( new java . awt . GridBagLayout ( ) ) ; addWindowListener ( new java . awt . event . WindowAdapter ( ) { public void windowClosing ( java . awt . event . WindowEvent evt ) { closeDialog ( evt ) ; } } ) ; userMessage = new javax . swing . JLabel ( ) ; userMessage . setText ( initialMessage ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . gridwidth = java . awt . GridBagConstraints . REMAINDER ; gridBagConstraints . insets = new java . awt . Insets ( 5 , 5 , 5 , 5 ) ; getContentPane ( ) . add ( userMessage , gridBagConstraints ) ; userLabel = new javax . swing . JLabel ( ) ; userLabel . setText ( "Email address" ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . insets = new java . awt . Insets ( 5 , 5 , 5 , 5 ) ; getContentPane ( ) . add ( userLabel , gridBagConstraints ) ; userField = new javax . swing . JTextField ( 20 ) ; userField . setText ( initialUsername ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . gridwidth = java . awt . GridBagConstraints . REMAINDER ; gridBagConstraints . insets = new java . awt . Insets ( 5 , 5 , 5 , 5 ) ; getContentPane ( ) . add ( userField , gridBagConstraints ) ; passwordLabel = new javax . swing . JLabel ( ) ; passwordLabel . setText ( "Password" ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . insets = new java . awt . Insets ( 5 , 5 , 5 , 5 ) ; getContentPane ( ) . add ( passwordLabel , gridBagConstraints ) ; passwordField = new javax . swing . JPasswordField ( 20 ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . gridwidth = java . awt . GridBagConstraints . REMAINDER ; gridBagConstraints . insets = new java . awt . Insets ( 5 , 5 , 5 , 5 ) ; getContentPane ( ) . add ( passwordField , gridBagConstraints ) ; rePasswordLabel = new javax . swing . JLabel ( ) ; rePasswordLabel . setText ( "Confirm password" ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . insets = new java . awt . Insets ( 5 , 5 , 5 , 5 ) ; getContentPane ( ) . add ( rePasswordLabel , gridBagConstraints ) ; rePasswordField = new javax . swing . JPasswordField ( 20 ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . gridwidth = java . awt . GridBagConstraints . REMAINDER ; gridBagConstraints . insets = new java . awt . Insets ( 5 , 5 , 5 , 5 ) ; getContentPane ( ) . add ( rePasswordField , gridBagConstraints ) ; saveInfoCheckbox = new javax . swing . JCheckBox ( ) ; saveInfoCheckbox . setText ( "Remember me?" ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . gridwidth = java . awt . GridBagConstraints . REMAINDER ; gridBagConstraints . insets = new java . awt . Insets ( 5 , 5 , 5 , 5 ) ; getContentPane ( ) . add ( saveInfoCheckbox , gridBagConstraints ) ; loginButton = new javax . swing . JButton ( ) ; loginButton . setText ( "Submit" ) ; loginButton . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { loginButtonActionPerformed ( evt ) ; } } ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . insets = new java . awt . Insets ( 5 , 5 , 5 , 5 ) ; getContentPane ( ) . add ( loginButton , gridBagConstraints ) ; getRootPane ( ) . setDefaultButton ( loginButton ) ; cancelButton = new javax . swing . JButton ( ) ; cancelButton . setText ( "Cancel" ) ; cancelButton . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { cancelButtonActionPerformed ( evt ) ; } } ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . insets = new java . awt . Insets ( 5 , 5 , 5 , 5 ) ; getContentPane ( ) . add ( cancelButton , gridBagConstraints ) ; pack ( ) ; |
public class FctBnSeSelEntityProcs { /** * < p > Get PrcHasSeSellerSave ( create and put into map ) . < / p >
* @ param pAddParam additional param
* @ return requested PrcHasSeSellerSave
* @ throws Exception - an exception */
protected final PrcHasSeSellerSave < RS , IHasSeSeller < Object > , Object > lazyGetPrcHasSeSellerSave ( final Map < String , Object > pAddParam ) throws Exception { } } | String beanName = PrcHasSeSellerSave . class . getSimpleName ( ) ; @ SuppressWarnings ( "unchecked" ) PrcHasSeSellerSave < RS , IHasSeSeller < Object > , Object > proc = ( PrcHasSeSellerSave < RS , IHasSeSeller < Object > , Object > ) this . processorsMap . get ( beanName ) ; if ( proc == null ) { proc = new PrcHasSeSellerSave < RS , IHasSeSeller < Object > , Object > ( ) ; proc . setSrvOrm ( getSrvOrm ( ) ) ; proc . setFindSeSeller ( getFindSeSeller ( ) ) ; // assigning fully initialized object :
this . processorsMap . put ( beanName , proc ) ; this . logger . info ( null , FctBnSeSelEntityProcs . class , beanName + " has been created." ) ; } return proc ; |
public class AbstractUserTypeHibernateIntegrator { /** * { @ inheritDoc } */
@ Override public void disintegrate ( SessionFactoryImplementor sessionFactory , SessionFactoryServiceRegistry serviceRegistry ) { } } | ConfigurationHelper . configureDefaultProperties ( sessionFactory , null ) ; |
public class OSecurityHelper { /** * Transform array of { @ link RequiredOrientResource } s to a { @ link HashMap } .
* { @ link HashMap } is required to be serializable
* @ param resources { @ link RequiredOrientResource } s to convert
* @ return { @ link HashMap } representation of an { @ link OrientPermission } s */
public static HashMap < String , OrientPermission [ ] > toSecureMap ( RequiredOrientResource ... resources ) { } } | HashMap < String , OrientPermission [ ] > secureMap = new HashMap < String , OrientPermission [ ] > ( ) ; for ( RequiredOrientResource requiredOrientResource : resources ) { String resource = requiredOrientResource . value ( ) ; String specific = requiredOrientResource . specific ( ) ; String action = requiredOrientResource . action ( ) ; if ( ! Strings . isEmpty ( specific ) ) resource = resource + "." + specific ; if ( ! Strings . isEmpty ( action ) ) resource = resource + ":" + action ; secureMap . put ( resource , requiredOrientResource . permissions ( ) ) ; } return secureMap ; |
public class ClassUtils { /** * Check whether the given class is present in the given classloader .
* @ param name The name of the class
* @ param classLoader The classloader . If null will fallback to attempt the thread context loader , otherwise the system loader
* @ return True if it is */
public static boolean isPresent ( String name , @ Nullable ClassLoader classLoader ) { } } | return forName ( name , classLoader ) . isPresent ( ) ; |
public class SystemConfiguration { /** * Returns for given < code > _ key < / code > the related value as Properties . If
* no attribute is found an empty Properties is returned .
* @ param _ key key of searched attribute
* @ param _ concatenate is concatenate or not
* @ return Properties
* @ throws EFapsException on error
* @ see # attributes */
public Properties getAttributeValueAsEncryptedProperties ( final String _key , final boolean _concatenate ) throws EFapsException { } } | final Properties properties = getAttributeValueAsProperties ( _key , _concatenate ) ; final StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor ( ) ; encryptor . setConfig ( SystemConfiguration . getPBEConfig ( ) ) ; final Properties props = new EncryptableProperties ( properties , encryptor ) ; return props ; |
public class SerializeHandlerFactory { /** * 根据http请求中的content - type尝试寻找序列化handler
* @ param protocol
* @ return
* @ throws InvalidProtocolException */
public static SerializeHandler getHandlerByProtocal ( String protocol ) throws InvalidProtocolException { } } | SerializeHandler handler = HANDLER_MAP . get ( protocol ) ; if ( handler != null ) { return handler ; } throw new InvalidProtocolException ( "rpc protocol not supported for " + protocol ) ; |
public class CommerceRegionModelImpl { /** * Converts the soap model instances into normal model instances .
* @ param soapModels the soap model instances to convert
* @ return the normal model instances */
public static List < CommerceRegion > toModels ( CommerceRegionSoap [ ] soapModels ) { } } | if ( soapModels == null ) { return null ; } List < CommerceRegion > models = new ArrayList < CommerceRegion > ( soapModels . length ) ; for ( CommerceRegionSoap soapModel : soapModels ) { models . add ( toModel ( soapModel ) ) ; } return models ; |
public class WTemplate { /** * Remove a template engine option .
* @ param key the engine option to remove */
public void removeEngineOption ( final String key ) { } } | TemplateModel model = getOrCreateComponentModel ( ) ; if ( model . engineOptions != null ) { model . engineOptions . remove ( key ) ; } |
public class PersistenceUnitMetadata { /** * Gets the property .
* @ param prop
* the prop
* @ return the property */
public String getProperty ( String prop ) { } } | // assuming Properties are initialized with this call
return prop != null ? getProperties ( ) . getProperty ( prop ) : null ; |
public class Queue { /** * Add subscribers to Queue . If there is no queue , an EmptyQueueException is thrown .
* @ param subscribers The array of subscribers .
* @ throws io . iron . ironmq . HTTPException If the IronMQ service returns a status other than 200 OK .
* @ throws java . io . IOException If there is an error accessing the IronMQ server . */
public void addSubscribers ( Subscribers subscribers ) throws IOException { } } | String payload = gson . toJson ( subscribers ) ; IronReader reader = client . post ( "queues/" + name + "/subscribers" , payload ) ; reader . close ( ) ; |
public class TransferManager { /** * Schedules a new transfer to download data from Amazon S3 and save it to
* the specified file . This method is non - blocking and returns immediately
* ( i . e . before the data has been fully downloaded ) .
* Use the returned Download object to query the progress of the transfer ,
* add listeners for progress events , and wait for the download to complete .
* If you are downloading < a href = " http : / / aws . amazon . com / kms / " > AWS
* KMS < / a > - encrypted objects , you need to specify the correct region of the
* bucket on your client and configure AWS Signature Version 4 for added
* security . For more information on how to do this , see
* http : / / docs . aws . amazon . com / AmazonS3 / latest / dev / UsingAWSSDK . html #
* specify - signature - version
* @ param getObjectRequest
* The request containing all the parameters for the download .
* @ param file
* The file to download the object data to .
* @ param timeoutMillis
* Timeout , in milliseconds , for waiting for this download to
* complete . Note that the timeout time will be approximate
* and is not strictly guaranteed . As a result this timeout
* should not be relied on in cases where exact precision is
* required .
* @ return A new < code > Download < / code > object to use to check the state of
* the download , listen for progress notifications , and otherwise
* manage the download .
* @ throws AmazonClientException
* If any errors are encountered in the client while making the
* request or handling the response .
* @ throws AmazonServiceException
* If any errors occurred in Amazon S3 while processing the
* request . */
public Download download ( final GetObjectRequest getObjectRequest , final File file , long timeoutMillis ) { } } | return doDownload ( getObjectRequest , file , null , null , OVERWRITE_MODE , timeoutMillis , null ) ; |
public class QRDecomposition { /** * Least squares solution of A * X = b
* @ param b A column vector b with as many rows as A .
* @ return X that minimizes the two norm of Q * R * X - b .
* @ throws IllegalArgumentException Matrix row dimensions must agree .
* @ throws ArithmeticException Matrix is rank deficient . */
public double [ ] solveInplace ( double [ ] b ) { } } | if ( b . length != m ) { throw new IllegalArgumentException ( ERR_MATRIX_DIMENSIONS ) ; } if ( ! this . isFullRank ( ) ) { throw new ArithmeticException ( ERR_MATRIX_RANK_DEFICIENT ) ; } // Compute Y = transpose ( Q ) * B
for ( int k = 0 ; k < n ; k ++ ) { double s = 0.0 ; for ( int i = k ; i < m ; i ++ ) { s += QR [ i ] [ k ] * b [ i ] ; } s /= QR [ k ] [ k ] ; for ( int i = k ; i < m ; i ++ ) { b [ i ] -= s * QR [ i ] [ k ] ; } } // Solve R * X = Y ;
for ( int k = n - 1 ; k >= 0 ; k -- ) { b [ k ] /= Rdiag [ k ] ; for ( int i = 0 ; i < k ; i ++ ) { final double QRik = QR [ i ] [ k ] ; b [ i ] -= b [ k ] * QRik ; } } return b ; |
public class Collections { /** * Returns an enumeration over the specified collection . This provides
* interoperability with legacy APIs that require an enumeration
* as input .
* @ param < T > the class of the objects in the collection
* @ param c the collection for which an enumeration is to be returned .
* @ return an enumeration over the specified collection .
* @ see Enumeration */
public static < T > Enumeration < T > enumeration ( final Collection < T > c ) { } } | return new Enumeration < T > ( ) { private final Iterator < T > i = c . iterator ( ) ; public boolean hasMoreElements ( ) { return i . hasNext ( ) ; } public T nextElement ( ) { return i . next ( ) ; } } ; |
public class KeyGenUtil { /** * Return true if any of the cache key generators in the array is a
* provisional cache key generator .
* @ param keyGens
* The array
* @ return True if there is a provisional cache key generator in the array */
static public boolean isProvisional ( Iterable < ICacheKeyGenerator > keyGens ) { } } | boolean provisional = false ; for ( ICacheKeyGenerator keyGen : keyGens ) { if ( keyGen . isProvisional ( ) ) { provisional = true ; break ; } } return provisional ; |
public class snmpmanager { /** * Use this API to fetch all the snmpmanager resources that are configured on netscaler . */
public static snmpmanager [ ] get ( nitro_service service ) throws Exception { } } | snmpmanager obj = new snmpmanager ( ) ; snmpmanager [ ] response = ( snmpmanager [ ] ) obj . get_resources ( service ) ; return response ; |
public class CharSequenceUtil { /** * Find index of first occurance of a character . This is different
* from { @ link String # indexOf ( String ) } in that it works on
* { @ link CharSequence } s and looks for a single character
* instead of a string .
* @ param str haystack
* @ param ch needle
* @ return position of needle in haystack or - 1 if not found . */
public static int indexOf ( CharSequence str , char ch ) { } } | for ( int i = 0 ; i < str . length ( ) ; i ++ ) if ( str . charAt ( i ) == ch ) return i ; return - 1 ; |
public class MultiIndex { /** * For investigation purposes only
* @ param remove
* @ param add
* @ throws IOException */
private void doUpdateRW ( final Collection < String > remove , final Collection < Document > add ) throws IOException { } } | // make sure a reader is available during long updates
if ( add . size ( ) > handler . getBufferSize ( ) ) { try { releaseMultiReader ( ) ; } catch ( IOException e ) { // do not fail if an exception is thrown here
LOG . warn ( "unable to prepare index reader " + "for queries during update" , e ) ; } } synchronized ( updateMonitor ) { // updateInProgress = true ;
indexUpdateMonitor . setUpdateInProgress ( true , false ) ; } boolean flush = false ; try { long transactionId = nextTransactionId ++ ; executeAndLog ( new Start ( transactionId ) ) ; for ( Iterator < String > it = remove . iterator ( ) ; it . hasNext ( ) ; ) { executeAndLog ( new DeleteNode ( transactionId , it . next ( ) ) ) ; } for ( Iterator < Document > it = add . iterator ( ) ; it . hasNext ( ) ; ) { Document doc = it . next ( ) ; if ( doc != null ) { executeAndLog ( new AddNode ( transactionId , doc ) ) ; // commit volatile index if needed
flush |= checkVolatileCommit ( ) ; } } executeAndLog ( new Commit ( transactionId ) ) ; // flush whole index when volatile index has been commited .
if ( flush ) { // if we are going to flush , need to set persistent update
synchronized ( updateMonitor ) { indexUpdateMonitor . setUpdateInProgress ( true , true ) ; } flush ( ) ; } } finally { synchronized ( updateMonitor ) { // updateInProgress = false ;
indexUpdateMonitor . setUpdateInProgress ( false , flush ) ; updateMonitor . notifyAll ( ) ; releaseMultiReader ( ) ; } } |
public class AbstractMacroDescriptor { /** * Extract parameters informations from { @ link # parametersBeanDescriptor } and insert it in
* { @ link # parameterDescriptorMap } .
* @ since 1.7M2 */
protected void extractParameterDescriptorMap ( ) { } } | for ( PropertyDescriptor propertyDescriptor : this . parametersBeanDescriptor . getProperties ( ) ) { DefaultParameterDescriptor desc = new DefaultParameterDescriptor ( propertyDescriptor ) ; this . parameterDescriptorMap . put ( desc . getId ( ) . toLowerCase ( ) , desc ) ; } |
public class Ifc4FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public IfcConstructionMaterialResourceTypeEnum createIfcConstructionMaterialResourceTypeEnumFromString ( EDataType eDataType , String initialValue ) { } } | IfcConstructionMaterialResourceTypeEnum result = IfcConstructionMaterialResourceTypeEnum . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class Relation { /** * Returns the NumberColumn at the given index .
* If the index points to a String or a boolean column , a new NumberColumn is created and returned
* TODO ( lwhite ) : Consider separating the indexed access and the column type mods , which must be for ML functions ( in smile or elsewhere )
* @ param columnIndex The 0 - based index of a column in the table
* @ return A number column
* @ throws ClassCastException if the cast to NumberColumn fails */
public NumberColumn < ? > numberColumn ( int columnIndex ) { } } | Column < ? > c = column ( columnIndex ) ; if ( c . type ( ) == ColumnType . STRING ) { return ( ( StringColumn ) c ) . asDoubleColumn ( ) ; } else if ( c . type ( ) == ColumnType . BOOLEAN ) { return ( ( BooleanColumn ) c ) . asDoubleColumn ( ) ; } else if ( c . type ( ) == ColumnType . LOCAL_DATE ) { return ( ( DateColumn ) c ) . asDoubleColumn ( ) ; } else if ( c . type ( ) == ColumnType . LOCAL_DATE_TIME ) { return ( ( DateTimeColumn ) c ) . asDoubleColumn ( ) ; } else if ( c . type ( ) == ColumnType . LOCAL_TIME ) { return ( ( TimeColumn ) c ) . asDoubleColumn ( ) ; } return ( NumberColumn < ? > ) column ( columnIndex ) ; |
public class SingletonContext { /** * This static method registers the SMB URL protocol handler which is
* required to use SMB URLs with the < tt > java . net . URL < / tt > class . If this
* method is not called before attempting to create an SMB URL with the
* URL class the following exception will occur :
* < blockquote >
* < pre >
* Exception MalformedURLException : unknown protocol : smb
* at java . net . URL . & lt ; init & gt ; ( URL . java : 480)
* at java . net . URL . & lt ; init & gt ; ( URL . java : 376)
* at java . net . URL . & lt ; init & gt ; ( URL . java : 330)
* at jcifs . smb . SmbFile . & lt ; init & gt ; ( SmbFile . java : 355)
* < / pre >
* < blockquote > */
public static void registerSmbURLHandler ( ) { } } | String pkgs ; float ver = Float . parseFloat ( Runtime . class . getPackage ( ) . getSpecificationVersion ( ) ) ; String vendor = System . getProperty ( "java.vendor.url" ) ; if ( ! ( vendor != null && vendor . startsWith ( "http://www.android.com" ) ) && ver < 1.7f ) { throw new RuntimeCIFSException ( "jcifs-ng requires Java 1.7 or above. You are running " + ver ) ; } SingletonContext . getInstance ( ) ; pkgs = System . getProperty ( "java.protocol.handler.pkgs" ) ; if ( pkgs == null ) { System . setProperty ( "java.protocol.handler.pkgs" , "jcifs" ) ; } else if ( pkgs . indexOf ( "jcifs" ) == - 1 ) { pkgs += "|jcifs" ; System . setProperty ( "java.protocol.handler.pkgs" , pkgs ) ; } |
public class StoryRunner { /** * Runs a Story with the given configuration and steps .
* @ param configuration the Configuration used to run story
* @ param candidateSteps the List of CandidateSteps containing the candidate
* steps methods
* @ param story the Story to run
* @ throws Throwable if failures occurred and FailureStrategy dictates it to
* be re - thrown . */
public void run ( Configuration configuration , List < CandidateSteps > candidateSteps , Story story ) throws Throwable { } } | run ( configuration , candidateSteps , story , MetaFilter . EMPTY ) ; |
public class DiagnosticsLogWriterImpl { /** * we can ' t rely on DateFormat since it generates a ton of garbage */
private void appendDateTime ( long epochMillis ) { } } | date . setTime ( epochMillis ) ; calendar . setTime ( date ) ; appendDate ( ) ; write ( ' ' ) ; appendTime ( ) ; |
public class Quaternion { /** * Get the roll , pitch and yaw angles in radians represented by this { @ link Quaternion } .
* @ return The roll , pitch and yaw angles ( in that order ) in radians represented by this { @ link Quaternion } . */
public double [ ] getRollPitchYaw ( ) { } } | double [ ] ret = new double [ 3 ] ; // roll ( x - axis rotation )
double sinr = + 2.0 * ( w * x + y * z ) ; double cosr = + 1.0 - 2.0 * ( x * x + y * y ) ; ret [ 0 ] = Math . atan2 ( sinr , cosr ) ; // pitch ( y - axis rotation )
double sinp = + 2.0 * ( w * y - z * x ) ; // use 90 degrees if out of range
if ( Math . abs ( sinp ) >= 1 ) ret [ 1 ] = Math . copySign ( Math . PI / 2.0 , sinp ) ; else ret [ 1 ] = Math . asin ( sinp ) ; // yaw ( z - axis rotation )
double siny = + 2.0 * ( w * z + x * y ) ; double cosy = + 1.0 - 2.0 * ( y * y + z * z ) ; ret [ 2 ] = Math . atan2 ( siny , cosy ) ; return ret ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.