signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class NettyClientConfig { /** * 因为每次连接执行都会init都会被remove , 所以每次调用booter都会用新的handler来进行连接配置
* @ param address
* @ param init
* @ return */
protected ChannelFuture doBooterConnect ( InetSocketAddress address , final ChannelHandler init ) { } } | ChannelFuture cf ; synchronized ( booter ) { if ( booter . config ( ) . group ( ) == null ) { booterInit ( ) ; } final CountDownLatch latch = new CountDownLatch ( 1 ) ; ChannelHandler handler = initHandlerAdapter ( init ) ; booter . handler ( handler ) ; cf = booter . connect ( address ) ; cf . addListener ( new ChannelFutureListener ( ) { @ Override public void operationComplete ( ChannelFuture future ) throws Exception { log . trace ( "connect operationComplete:isDone=" + future . isDone ( ) + ",isSuccess=" + future . isSuccess ( ) ) ; if ( future . isDone ( ) && future . isSuccess ( ) ) { latch . countDown ( ) ; } } } ) ; try { latch . await ( getConnectTimeOutMills ( ) , TimeUnit . MILLISECONDS ) ; } catch ( Exception e ) { log . error ( e . getMessage ( ) , e ) ; } } return cf ; |
public class Utility { /** * Escape unprintable characters using < backslash > uxxxx notation
* for U + 0000 to U + FFFF and < backslash > Uxxxxx for U + 10000 and
* above . If the character is printable ASCII , then do nothing
* and return FALSE . Otherwise , append the escaped notation and
* return TRUE . */
public static < T extends Appendable > boolean escapeUnprintable ( T result , int c ) { } } | try { if ( isUnprintable ( c ) ) { result . append ( '\\' ) ; if ( ( c & ~ 0xFFFF ) != 0 ) { result . append ( 'U' ) ; result . append ( DIGITS [ 0xF & ( c >> 28 ) ] ) ; result . append ( DIGITS [ 0xF & ( c >> 24 ) ] ) ; result . append ( DIGITS [ 0xF & ( c >> 20 ) ] ) ; result . append ( DIGITS [ 0xF & ( c >> 16 ) ] ) ; } else { result . append ( 'u' ) ; } result . append ( DIGITS [ 0xF & ( c >> 12 ) ] ) ; result . append ( DIGITS [ 0xF & ( c >> 8 ) ] ) ; result . append ( DIGITS [ 0xF & ( c >> 4 ) ] ) ; result . append ( DIGITS [ 0xF & c ] ) ; return true ; } return false ; } catch ( IOException e ) { throw new IllegalIcuArgumentException ( e ) ; } |
public class ServerRequest { /** * < p > Sets a { @ link JSONObject } containing the post data supplied with the current request . < / p >
* @ param post A { @ link JSONObject } containing the post data supplied with the current request
* as key - value pairs . */
protected void setPost ( JSONObject post ) throws JSONException { } } | params_ = post ; if ( getBranchRemoteAPIVersion ( ) == BRANCH_API_VERSION . V2 ) { try { JSONObject userDataObj = new JSONObject ( ) ; params_ . put ( Defines . Jsonkey . UserData . getKey ( ) , userDataObj ) ; DeviceInfo . getInstance ( ) . updateRequestWithV2Params ( context_ , prefHelper_ , userDataObj ) ; } catch ( JSONException ignore ) { } } else { DeviceInfo . getInstance ( ) . updateRequestWithV1Params ( params_ ) ; } |
public class EnforcementJobRestEntity { /** * Gets an specific enforcements given a agreementId If the enforcementJob
* it is not in the database , it returns 404 with empty payload
* < pre >
* GET / enforcements / { agreementId }
* Request :
* GET / enforcements HTTP / 1.1
* Response :
* { @ code
* < ? xml version = " 1.0 " encoding = " UTF - 8 " ? >
* < enforcement _ job >
* < agreement _ id > agreement04 < / agreement _ id >
* < enabled > false < / enabled >
* < / enforcement _ job >
* < / pre >
* Example : < li > curl
* http : / / localhost : 8080 / sla - service / enforcements / agreement04 < / li >
* @ param agreementId
* of the enforcementJob
* @ return XML information with the different details of the enforcementJob */
@ GET @ Path ( "{agreementId}" ) public EnforcementJob getEnforcementJobByAgreementId ( @ PathParam ( "agreementId" ) String agreementUUID ) throws NotFoundException { } } | logger . debug ( "StartOf getEnforcementJobByAgreementId - REQUEST for /enforcements/{}" , agreementUUID ) ; EnforcementJobHelperE enforcementJobService = getHelper ( ) ; EnforcementJob enforcementJob = enforcementJobService . getEnforcementJobByUUID ( agreementUUID ) ; if ( enforcementJob == null ) { logger . info ( "getEnforcementJobByAgreementId NotFoundException: There is no agreement with uuid " + agreementUUID + " in the SLA Repository Database" ) ; throw new NotFoundException ( "There is no enforcement job associated to the agreement with uuid " + agreementUUID + " in the SLA Repository Database" ) ; } logger . debug ( "EndOf getEnforcementJobByAgreementId" ) ; return enforcementJob ; |
public class AbstractHttpTransport { /** * Returns a map containing the has - condition / value pairs specified in the request
* @ param request
* The http request object
* @ param versionError
* True if a version error was detected .
* @ return The map containing the has - condition / value pairs .
* @ throws IOException */
protected Features getFeaturesFromRequest ( HttpServletRequest request , boolean versionError ) throws IOException { } } | final String sourceMethod = "getFeaturesFromRequest" ; // $ NON - NLS - 1 $
boolean isTraceLogging = log . isLoggable ( Level . FINER ) ; if ( isTraceLogging ) { log . entering ( sourceClass , sourceMethod , new Object [ ] { request , versionError } ) ; } StringBuffer sb = request . getRequestURL ( ) ; if ( sb != null && request . getQueryString ( ) != null ) { sb . append ( "?" ) . append ( request . getQueryString ( ) ) ; // $ NON - NLS - 1 $
} Features defaultFeatures = getAggregator ( ) . getConfig ( ) . getDefaultFeatures ( sb != null ? sb . toString ( ) : null ) ; Features features = null ; if ( ! versionError ) { // don ' t trust feature encoding if version changed
features = getFeaturesFromRequestEncoded ( request , defaultFeatures ) ; } if ( features == null ) { features = new Features ( defaultFeatures ) ; String has = getHasConditionsFromRequest ( request ) ; if ( has != null ) { for ( String s : has . split ( "[;,*]" ) ) { // $ NON - NLS - 1 $
boolean value = true ; if ( s . startsWith ( "!" ) ) { // $ NON - NLS - 1 $
s = s . substring ( 1 ) ; value = false ; } features . put ( s , value ) ; } } } if ( isTraceLogging ) { log . exiting ( sourceClass , sourceMethod , features ) ; } return features . unmodifiableFeatures ( ) ; |
public class Webcam { /** * Get RAW image ByteBuffer . It will always return buffer with 3 x 1 bytes per each pixel , where
* RGB components are on ( 0 , 1 , 2 ) and color space is sRGB . < br >
* < br >
* < b > IMPORTANT ! < / b > < br >
* Some drivers can return direct ByteBuffer , so there is no guarantee that underlying bytes
* will not be released in next read image operation . Therefore , to avoid potential bugs you
* should convert this ByteBuffer to bytes array before you fetch next image .
* @ return Byte buffer */
public ByteBuffer getImageBytes ( ) { } } | if ( ! isReady ( ) ) { return null ; } assert driver != null ; assert device != null ; long t1 = 0 ; long t2 = 0 ; // some devices can support direct image buffers , and for those call
// processor task , and for those which does not support direct image
// buffers , just convert image to RGB byte array
if ( device instanceof BufferAccess ) { t1 = System . currentTimeMillis ( ) ; try { return new WebcamGetBufferTask ( driver , device ) . getBuffer ( ) ; } finally { t2 = System . currentTimeMillis ( ) ; if ( device instanceof WebcamDevice . FPSSource ) { fps = ( ( WebcamDevice . FPSSource ) device ) . getFPS ( ) ; } else { fps = ( 4 * fps + 1000 / ( t2 - t1 + 1 ) ) / 5 ; } } } else { throw new IllegalStateException ( String . format ( "Driver %s does not support buffer access" , driver . getClass ( ) . getName ( ) ) ) ; } |
public class StatsHelper { /** * TODO : change to StringBuffer for better performance */
public static String statsToTclAttrString ( StatsImpl stats , DataDescriptor dd , String nodeName , String serverName ) { } } | return statsToTclAttrString ( null , stats , dd , nodeName , serverName ) ; |
public class DependencyVersion { /** * Parses a version string into its sub parts : major , minor , revision ,
* build , etc . < b > Note < / b > , this should only be used to parse something that
* is already known to be a version number .
* @ param version the version string to parse */
public final void parseVersion ( String version ) { } } | versionParts = new ArrayList < > ( ) ; if ( version != null ) { final Pattern rx = Pattern . compile ( "(\\d+[a-z]{1,3}$|[a-z]+\\d+|\\d+|(release|beta|alpha)$)" ) ; final Matcher matcher = rx . matcher ( version . toLowerCase ( ) ) ; while ( matcher . find ( ) ) { versionParts . add ( matcher . group ( ) ) ; } if ( versionParts . isEmpty ( ) ) { versionParts . add ( version ) ; } } |
public class MessageAttributeValue { /** * Not implemented . Reserved for future use .
* @ return Not implemented . Reserved for future use . */
public java . util . List < java . nio . ByteBuffer > getBinaryListValues ( ) { } } | if ( binaryListValues == null ) { binaryListValues = new com . amazonaws . internal . SdkInternalList < java . nio . ByteBuffer > ( ) ; } return binaryListValues ; |
public class MapperHelper { /** * 配置指定的接口
* @ param configuration
* @ param mapperInterface */
public void processConfiguration ( Configuration configuration , Class < ? > mapperInterface ) { } } | String prefix ; if ( mapperInterface != null ) { prefix = mapperInterface . getCanonicalName ( ) ; } else { prefix = "" ; } for ( Object object : new ArrayList < Object > ( configuration . getMappedStatements ( ) ) ) { if ( object instanceof MappedStatement ) { MappedStatement ms = ( MappedStatement ) object ; if ( ms . getId ( ) . startsWith ( prefix ) ) { processMappedStatement ( ms ) ; } } } |
public class XStreamTranscoder { /** * Get the object represented by the given serialized bytes .
* @ param in
* the bytes to deserialize
* @ return the resulting object */
@ Override public ConcurrentMap < String , Object > deserializeAttributes ( final byte [ ] in ) { } } | final ByteArrayInputStream bis = new ByteArrayInputStream ( in ) ; try { @ SuppressWarnings ( "unchecked" ) final ConcurrentMap < String , Object > result = ( ConcurrentMap < String , Object > ) _xstream . fromXML ( bis ) ; return result ; } catch ( final RuntimeException e ) { LOG . warn ( "Caught Exception decoding " + in . length + " bytes of data" , e ) ; throw new TranscoderDeserializationException ( e ) ; } finally { closeSilently ( bis ) ; } |
public class AbstractPrintQuery { /** * Get the String representation of a phrase .
* @ param _ selectBldr the select bldr
* @ param _ msgPhrase the msg phrase
* @ return String representation of the phrase
* @ throws EFapsException on error */
public String getMsgPhrase ( final SelectBuilder _selectBldr , final CIMsgPhrase _msgPhrase ) throws EFapsException { } } | return getMsgPhrase ( _selectBldr , _msgPhrase . getMsgPhrase ( ) ) ; |
public class OrgAPI { /** * Returns the members , both invited and active , of the given organization .
* This method is only available for organization administrators . For users
* only invited , only very limited information will be returned for the user
* and profile .
* @ param orgId
* The id of the organization
* @ return The list of members on the organization with detailed information */
public List < OrganizationMember > getMembers ( int orgId ) { } } | return getResourceFactory ( ) . getApiResource ( "/org/" + orgId + "/member/" ) . get ( new GenericType < List < OrganizationMember > > ( ) { } ) ; |
public class ConsumerDispatcher { /** * Method setReadyForUse .
* < p > Sets the state of the ConsumerDispatcher to " READY _ FOR _ USE " < / p > */
@ Override public void setReadyForUse ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setReadyForUse" ) ; state = SIMPState . READY_FOR_USE ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setReadyForUse" ) ; |
public class HibernateBundle { /** * Override to configure the { @ link Hibernate5Module } . */
protected Hibernate5Module createHibernate5Module ( ) { } } | Hibernate5Module module = new Hibernate5Module ( ) ; if ( lazyLoadingEnabled ) { module . enable ( Feature . FORCE_LAZY_LOADING ) ; } return module ; |
public class EndpointMessageResultMarshaller { /** * Marshall the given parameter object . */
public void marshall ( EndpointMessageResult endpointMessageResult , ProtocolMarshaller protocolMarshaller ) { } } | if ( endpointMessageResult == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( endpointMessageResult . getAddress ( ) , ADDRESS_BINDING ) ; protocolMarshaller . marshall ( endpointMessageResult . getDeliveryStatus ( ) , DELIVERYSTATUS_BINDING ) ; protocolMarshaller . marshall ( endpointMessageResult . getMessageId ( ) , MESSAGEID_BINDING ) ; protocolMarshaller . marshall ( endpointMessageResult . getStatusCode ( ) , STATUSCODE_BINDING ) ; protocolMarshaller . marshall ( endpointMessageResult . getStatusMessage ( ) , STATUSMESSAGE_BINDING ) ; protocolMarshaller . marshall ( endpointMessageResult . getUpdatedToken ( ) , UPDATEDTOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class Period { /** * Returns a copy of this period with the specified months subtracted .
* This subtracts the amount from the months unit in a copy of this period .
* The years and days units are unaffected .
* For example , " 1 year , 6 months and 3 days " minus 2 months returns " 1 year , 4 months and 3 days " .
* This instance is immutable and unaffected by this method call .
* @ param monthsToSubtract the years to subtract , positive or negative
* @ return a { @ code Period } based on this period with the specified months subtracted , not null
* @ throws ArithmeticException if numeric overflow occurs */
public Period minusMonths ( long monthsToSubtract ) { } } | return ( monthsToSubtract == Long . MIN_VALUE ? plusMonths ( Long . MAX_VALUE ) . plusMonths ( 1 ) : plusMonths ( - monthsToSubtract ) ) ; |
public class FormatStep { /** * < p > Startet einen neuen oder - Block . < / p >
* @ return updated format step
* @ throws IllegalStateException if a new or - block was already started
* @ since 3.14/4.11 */
FormatStep startNewOrBlock ( ) { } } | if ( this . orMarker ) { throw new IllegalStateException ( "Cannot start or-block twice." ) ; } return new FormatStep ( this . processor , this . level , this . section , this . sectionalAttrs , null , // called before build of formatter
this . reserved , this . padLeft , this . padRight , true , - 1 ) ; |
public class SequenceRenderer { /** * Initialize resolution .
* @ param source The resolution source ( must not be < code > null < / code > ) .
* @ throws LionEngineException If invalid argument . */
void initResolution ( Resolution source ) { } } | Check . notNull ( source ) ; setSystemCursorVisible ( cursorVisibility . booleanValue ( ) ) ; this . source = source ; screen . onSourceChanged ( source ) ; final int width = source . getWidth ( ) ; final int height = source . getHeight ( ) ; // Standard rendering
final Resolution output = config . getOutput ( ) ; if ( FilterNone . INSTANCE . equals ( filter ) && width == output . getWidth ( ) && height == output . getHeight ( ) ) { buf = null ; transform = null ; } // Scaled rendering
else { buf = Graphics . createImageBuffer ( width , height ) ; transform = getTransform ( ) ; final Graphic gbuf = buf . createGraphic ( ) ; graphic . setGraphic ( gbuf . getGraphic ( ) ) ; } |
public class AccuracyWeightedEnsemble { /** * Processes a chunk .
* @ param useMseR Determines whether to use the MSEr threshold . */
protected void processChunk ( ) { } } | // Compute weights
double candidateClassifierWeight = this . computeCandidateWeight ( this . candidateClassifier , this . currentChunk , this . numFolds ) ; for ( int i = 0 ; i < this . storedLearners . length ; i ++ ) { this . storedWeights [ i ] [ 0 ] = this . computeWeight ( this . storedLearners [ ( int ) this . storedWeights [ i ] [ 1 ] ] , this . currentChunk ) ; } if ( this . storedLearners . length < this . maxStoredCount ) { // Train and add classifier
for ( int num = 0 ; num < this . chunkSize ; num ++ ) { this . candidateClassifier . trainOnInstance ( this . currentChunk . instance ( num ) ) ; } this . addToStored ( this . candidateClassifier , candidateClassifierWeight ) ; } else { // Substitute poorest classifier
java . util . Arrays . sort ( this . storedWeights , weightComparator ) ; if ( this . storedWeights [ 0 ] [ 0 ] < candidateClassifierWeight ) { for ( int num = 0 ; num < this . chunkSize ; num ++ ) { this . candidateClassifier . trainOnInstance ( this . currentChunk . instance ( num ) ) ; } this . storedWeights [ 0 ] [ 0 ] = candidateClassifierWeight ; this . storedLearners [ ( int ) this . storedWeights [ 0 ] [ 1 ] ] = this . candidateClassifier . copy ( ) ; } } int ensembleSize = java . lang . Math . min ( this . storedLearners . length , this . maxMemberCount ) ; this . ensemble = new Classifier [ ensembleSize ] ; this . ensembleWeights = new double [ ensembleSize ] ; // Sort learners according to their weights
java . util . Arrays . sort ( this . storedWeights , weightComparator ) ; // Select top k classifiers to construct the ensemble
int storeSize = this . storedLearners . length ; for ( int i = 0 ; i < ensembleSize ; i ++ ) { this . ensembleWeights [ i ] = this . storedWeights [ storeSize - i - 1 ] [ 0 ] ; this . ensemble [ i ] = this . storedLearners [ ( int ) this . storedWeights [ storeSize - i - 1 ] [ 1 ] ] ; } this . classDistributions = null ; this . currentChunk = null ; this . candidateClassifier = ( Classifier ) getPreparedClassOption ( this . learnerOption ) ; this . candidateClassifier . resetLearning ( ) ; |
public class S4WindowTinyLfuPolicy { /** * Returns all variations of this policy based on the configuration parameters . */
public static Set < Policy > policies ( Config config ) { } } | S4WindowTinyLfuSettings settings = new S4WindowTinyLfuSettings ( config ) ; return settings . percentMain ( ) . stream ( ) . map ( percentMain -> new S4WindowTinyLfuPolicy ( percentMain , settings ) ) . collect ( toSet ( ) ) ; |
public class UserDistributionDataPointTypeImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } } | switch ( featureID ) { case BpsimPackage . USER_DISTRIBUTION_DATA_POINT_TYPE__PARAMETER_VALUE_GROUP : if ( coreType ) return getParameterValueGroup ( ) ; return ( ( FeatureMap . Internal ) getParameterValueGroup ( ) ) . getWrapper ( ) ; case BpsimPackage . USER_DISTRIBUTION_DATA_POINT_TYPE__PARAMETER_VALUE : return getParameterValue ( ) ; case BpsimPackage . USER_DISTRIBUTION_DATA_POINT_TYPE__PROBABILITY : return getProbability ( ) ; } return super . eGet ( featureID , resolve , coreType ) ; |
public class ClientSessionSubmitter { /** * Submits a query to the cluster .
* @ param query The query to submit .
* @ param < T > The query result type .
* @ return A completable future to be completed once the query has been submitted . */
public < T > CompletableFuture < T > submit ( Query < T > query ) { } } | CompletableFuture < T > future = new CompletableFuture < > ( ) ; context . executor ( ) . execute ( ( ) -> submitQuery ( query , future ) ) ; return future ; |
public class AnnotationTypeRequiredMemberBuilder { /** * Build the comments for the member . Do nothing if
* { @ link Configuration # nocomment } is set to true .
* @ param node the XML element that specifies which components to document
* @ param annotationDocTree the content tree to which the documentation will be added */
public void buildMemberComments ( XMLNode node , Content annotationDocTree ) { } } | if ( ! configuration . nocomment ) { writer . addComments ( currentMember , annotationDocTree ) ; } |
public class ComputationGraph { /** * Fit the ComputationGraph using a MultiDataSet */
public void fit ( MultiDataSet multiDataSet ) { } } | fit ( multiDataSet . getFeatures ( ) , multiDataSet . getLabels ( ) , multiDataSet . getFeaturesMaskArrays ( ) , multiDataSet . getLabelsMaskArrays ( ) ) ; if ( multiDataSet . hasMaskArrays ( ) ) clearLayerMaskArrays ( ) ; |
public class DescribeCommand { /** * < pre > - - tags < / pre >
* Instead of using only the annotated tags , use any tag found in . git / refs / tags .
* This option enables matching a lightweight ( non - annotated ) tag .
* < p > Searching for lightweight tags is < b > false < / b > by default . < / p >
* Example :
* < pre >
* b6a73ed - ( HEAD , master )
* d37a598 - ( v1.0 - fixed - stuff ) - a lightweight tag ( with no message )
* 9597545 - ( v1.0 ) - an annotated tag
* $ git describe
* annotated - tag - 2 - gb6a73ed # the nearest " annotated " tag is found
* $ git describe - - tags
* lightweight - tag - 1 - gb6a73ed # the nearest tag ( including lightweights ) is found
* < / pre >
* Using only annotated tags to mark builds may be useful if you ' re using tags to help yourself with annotating
* things like " i ' ll get back to that " etc - you don ' t need such tags to be exposed . But if you want lightweight
* tags to be included in the search , enable this option . */
@ Nonnull public DescribeCommand tags ( @ Nullable Boolean includeLightweightTagsInSearch ) { } } | if ( includeLightweightTagsInSearch != null && includeLightweightTagsInSearch ) { tagsFlag = includeLightweightTagsInSearch ; log . info ( "--tags = {}" , includeLightweightTagsInSearch ) ; } return this ; |
public class AttributeQuery { /** * Execute the actual statement against the database .
* @ param _ complStmt Statment to be executed
* @ return true if executed with success
* @ throws EFapsException on error */
protected boolean executeOneCompleteStmt ( final String _complStmt ) throws EFapsException { } } | final boolean ret = false ; ConnectionResource con = null ; try { con = Context . getThreadContext ( ) . getConnectionResource ( ) ; if ( AbstractObjectQuery . LOG . isDebugEnabled ( ) ) { AbstractObjectQuery . LOG . debug ( _complStmt . toString ( ) ) ; } final Statement stmt = con . createStatement ( ) ; final ResultSet rs = stmt . executeQuery ( _complStmt . toString ( ) ) ; new ArrayList < Instance > ( ) ; while ( rs . next ( ) ) { getValues ( ) . add ( rs . getObject ( 1 ) ) ; } rs . close ( ) ; stmt . close ( ) ; } catch ( final SQLException e ) { throw new EFapsException ( AttributeQuery . class , "executeOneCompleteStmt" , e ) ; } return ret ; |
public class ControlMessageFactoryImpl { /** * Create a new , empty ControlResetRequestAckAck Message
* @ return The new ControlResetRequestAckAck
* @ exception MessageCreateFailedException Thrown if such a message can not be created */
public final ControlResetRequestAckAck createNewControlResetRequestAckAck ( ) throws MessageCreateFailedException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createNewControlResetRequestAckAck" ) ; ControlResetRequestAckAck msg = null ; try { msg = new ControlResetRequestAckAckImpl ( MfpConstants . CONSTRUCTOR_NO_OP ) ; } catch ( MessageDecodeFailedException e ) { /* No need to FFDC this as JsMsgObject will already have done so */
// No FFDC code needed
throw new MessageCreateFailedException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createNewControlResetRequestAckAck" ) ; return msg ; |
public class Logging { /** * Log a statistics object .
* @ param stats Statistics object to report . */
public void statistics ( Statistic stats ) { } } | if ( stats != null ) { log ( Level . STATISTICS , stats . getKey ( ) + ": " + stats . formatValue ( ) ) ; } |
public class ContentSpecParser { /** * TODO
* @ param parserData
* @ param value
* @ param key
* @ return */
private SpecTopic parseSpecTopicMetaData ( final ParserData parserData , final String value , final String key , final int lineNumber ) throws ParsingException { } } | final String fixedValue = value . trim ( ) . replaceAll ( "(?i)^" + key + "\\s*" , "" ) ; if ( fixedValue . trim ( ) . startsWith ( "[" ) && fixedValue . trim ( ) . endsWith ( "]" ) ) { final String topicString = key + " " + fixedValue . trim ( ) ; return parseTopic ( parserData , topicString , lineNumber ) ; } else { if ( fixedValue . trim ( ) . startsWith ( "[" ) ) { throw new ParsingException ( format ( ProcessorConstants . ERROR_NO_ENDING_BRACKET_MSG , lineNumber , ']' ) ) ; } else if ( fixedValue . trim ( ) . endsWith ( "]" ) ) { throw new ParsingException ( format ( ProcessorConstants . ERROR_NO_OPENING_BRACKET_MSG , lineNumber , '[' ) ) ; } else { throw new ParsingException ( format ( ProcessorConstants . ERROR_NO_BRACKET_MSG , lineNumber , '[' , ']' ) ) ; } } |
public class DoradusServer { /** * Start all registered services . */
private void startServices ( ) { } } | m_logger . info ( "Starting services: {}" , simpleServiceNames ( m_initializedServices ) ) ; for ( Service service : m_initializedServices ) { m_logger . debug ( "Starting service: " + service . getClass ( ) . getSimpleName ( ) ) ; service . start ( ) ; m_startedServices . add ( service ) ; } |
public class CClassLoader { /** * reload this loader
* @ param config
* a loader config object */
public final void reload ( final CClassLoaderConfig config ) { } } | if ( this == CClassLoader . getRootLoader ( ) ) { return ; } if ( config == null ) { return ; } final CClassLoader parent = ( ( CClassLoader ) this . getParent ( ) ) ; parent . removeLoader ( this . name ) ; if ( this . isMandatory ( ) ) { CClassLoader . mandatoryLoadersMap . remove ( this . getPath ( ) ) ; } final CClassLoader newLoader = CClassLoader . getLoader ( parent . getPath ( ) + "/" + this . name ) ; newLoader . config = this . config ; newLoader . booAlone = this . booAlone ; newLoader . booMandatory = this . booMandatory ; newLoader . booResourceOnly = this . booResourceOnly ; newLoader . booDoNotForwardToParent = this . booDoNotForwardToParent ; final List list = ( List ) config . getFilesMap ( ) . get ( this . path ) ; for ( final Iterator f = list . iterator ( ) ; f . hasNext ( ) ; ) { final URL file = ( URL ) f . next ( ) ; newLoader . readDirectories ( file ) ; } final Iterator it = this . childrenMap . keySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { final CClassLoader child = ( CClassLoader ) this . childrenMap . get ( it . next ( ) ) ; child . reload ( ) ; } this . _destroy ( null ) ; if ( newLoader . isMandatory ( ) ) { CClassLoader . mandatoryLoadersMap . put ( newLoader . getPath ( ) , newLoader ) ; } newLoader . booInit = true ; |
public class VariableModel { /** * Returns a child of the given node . */
@ Override public Object getChild ( Object nodeObj , int i ) { } } | if ( debugger == null ) { return null ; } VariableNode node = ( VariableNode ) nodeObj ; return children ( node ) [ i ] ; |
public class LongTermRetentionBackupsInner { /** * Gets a long term retention backup .
* @ param locationName The location of the database .
* @ param longTermRetentionServerName the String value
* @ param longTermRetentionDatabaseName the String value
* @ param backupName The backup name .
* @ 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 < LongTermRetentionBackupInner > getAsync ( String locationName , String longTermRetentionServerName , String longTermRetentionDatabaseName , String backupName , final ServiceCallback < LongTermRetentionBackupInner > serviceCallback ) { } } | return ServiceFuture . fromResponse ( getWithServiceResponseAsync ( locationName , longTermRetentionServerName , longTermRetentionDatabaseName , backupName ) , serviceCallback ) ; |
public class ObjectIntMap { /** * Skips checks for existing keys . */
private void putResize ( K key , int value ) { } } | // Check for empty buckets .
int hashCode = key . hashCode ( ) ; int index1 = hashCode & mask ; K key1 = keyTable [ index1 ] ; if ( key1 == null ) { keyTable [ index1 ] = key ; valueTable [ index1 ] = value ; if ( size ++ >= threshold ) resize ( capacity << 1 ) ; return ; } int index2 = hash2 ( hashCode ) ; K key2 = keyTable [ index2 ] ; if ( key2 == null ) { keyTable [ index2 ] = key ; valueTable [ index2 ] = value ; if ( size ++ >= threshold ) resize ( capacity << 1 ) ; return ; } int index3 = hash3 ( hashCode ) ; K key3 = keyTable [ index3 ] ; if ( key3 == null ) { keyTable [ index3 ] = key ; valueTable [ index3 ] = value ; if ( size ++ >= threshold ) resize ( capacity << 1 ) ; return ; } push ( key , value , index1 , key1 , index2 , key2 , index3 , key3 ) ; |
public class ApiOvhTelephony { /** * Get this object properties
* REST : GET / telephony / { billingAccount } / easyHunting / { serviceName } / sound / { soundId }
* @ param billingAccount [ required ] The name of your billingAccount
* @ param serviceName [ required ]
* @ param soundId [ required ] */
public OvhOvhPabxSound billingAccount_easyHunting_serviceName_sound_soundId_GET ( String billingAccount , String serviceName , Long soundId ) throws IOException { } } | String qPath = "/telephony/{billingAccount}/easyHunting/{serviceName}/sound/{soundId}" ; StringBuilder sb = path ( qPath , billingAccount , serviceName , soundId ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhOvhPabxSound . class ) ; |
public class HtmlTree { /** * Generates a Table tag with style class , border , cell padding ,
* cellspacing and summary attributes and some content .
* @ param styleClass style of the table
* @ param border border for the table
* @ param cellPadding cell padding for the table
* @ param cellSpacing cell spacing for the table
* @ param summary summary for the table
* @ param body content for the table
* @ return an HtmlTree object for the TABLE tag */
public static HtmlTree TABLE ( HtmlStyle styleClass , int border , int cellPadding , int cellSpacing , String summary , Content body ) { } } | HtmlTree htmltree = new HtmlTree ( HtmlTag . TABLE , nullCheck ( body ) ) ; if ( styleClass != null ) htmltree . addStyle ( styleClass ) ; htmltree . addAttr ( HtmlAttr . BORDER , Integer . toString ( border ) ) ; htmltree . addAttr ( HtmlAttr . CELLPADDING , Integer . toString ( cellPadding ) ) ; htmltree . addAttr ( HtmlAttr . CELLSPACING , Integer . toString ( cellSpacing ) ) ; htmltree . addAttr ( HtmlAttr . SUMMARY , nullCheck ( summary ) ) ; return htmltree ; |
public class GuestAuthManager { /** * * It should have returned a boolean , but . . .
* Watch out GuestPermissionDenied ( subtype of GuestOperationsFault )
* for invalid authentication . */
public void ValidateCredentialsInGuest ( GuestAuthentication auth ) throws GuestOperationsFault , InvalidState , TaskInProgress , RuntimeFault , RemoteException { } } | getVimService ( ) . validateCredentialsInGuest ( getMOR ( ) , vm . getMOR ( ) , auth ) ; |
public class GuidedDTDRLPersistence { /** * take a CSV list and turn it into DRL syntax */
String makeInList ( final String cell ) { } } | if ( cell . startsWith ( "(" ) ) { return cell ; } String result = "" ; Iterator < String > iterator = Arrays . asList ( ListSplitter . split ( "\"" , true , cell ) ) . iterator ( ) ; while ( iterator . hasNext ( ) ) { final String item = iterator . next ( ) ; if ( item . startsWith ( "\"" ) ) { result += item ; } else { result += "\"" + item + "\"" ; } if ( iterator . hasNext ( ) ) { result += ", " ; } } return "(" + result + ")" ; |
public class LocalQueueSession { /** * ( non - Javadoc )
* @ see javax . jms . QueueSession # createSender ( javax . jms . Queue ) */
@ Override public QueueSender createSender ( Queue queue ) throws JMSException { } } | externalAccessLock . readLock ( ) . lock ( ) ; try { checkNotClosed ( ) ; LocalQueueSender sender = new LocalQueueSender ( this , queue , idProvider . createID ( ) ) ; registerProducer ( sender ) ; return sender ; } finally { externalAccessLock . readLock ( ) . unlock ( ) ; } |
public class AttributeMethodBuilder { /** * Create a Tango attribute { @ link Attribute }
* @ param device
* @ param businessObject
* @ param method
* @ param isOnDeviceImpl
* @ throws DevFailed */
public void build ( final DeviceImpl device , final Object businessObject , final Method method , final boolean isOnDeviceImpl ) throws DevFailed { } } | xlogger . entry ( ) ; Object target ; if ( isOnDeviceImpl ) { target = device ; } else { target = businessObject ; } checkSyntax ( method ) ; // retrieve field attribute
final String getterName ; final String setterName ; final String removedGet ; final String fieldName ; final Class < ? > type ; Method setter = null ; Method getter = null ; if ( method . getName ( ) . startsWith ( BuilderUtils . GET ) || method . getName ( ) . startsWith ( BuilderUtils . IS ) ) { getter = method ; getterName = method . getName ( ) ; removedGet = getterName . startsWith ( BuilderUtils . GET ) ? getterName . substring ( 3 ) : getterName ; setterName = BuilderUtils . SET + removedGet ; fieldName = removedGet . substring ( 0 , 1 ) . toLowerCase ( Locale . ENGLISH ) + removedGet . substring ( 1 ) ; type = method . getReturnType ( ) ; try { setter = target . getClass ( ) . getMethod ( setterName , type ) ; } catch ( final NoSuchMethodException e ) { // attribute is write only
} } else { setter = method ; setterName = method . getName ( ) ; removedGet = setterName . substring ( 3 ) ; fieldName = removedGet . substring ( 0 , 1 ) . toLowerCase ( Locale . ENGLISH ) + removedGet . substring ( 1 ) ; if ( method . getParameterTypes ( ) . length != 1 ) { throw DevFailedUtils . newDevFailed ( BuilderUtils . INIT_ERROR , setterName + " must have only one parameter" ) ; } type = method . getParameterTypes ( ) [ 0 ] ; final Class < ? > attrType = AttributeTangoType . getTypeFromClass ( type ) . getType ( ) ; if ( boolean . class . isAssignableFrom ( attrType ) ) { getterName = BuilderUtils . IS + removedGet ; } else { getterName = BuilderUtils . GET + removedGet ; } try { getter = target . getClass ( ) . getMethod ( getterName ) ; } catch ( final NoSuchMethodException e ) { // attribute is write only
} } checkNull ( getterName , setterName , setter , getter ) ; final Attribute annot = method . getAnnotation ( Attribute . class ) ; final String attributeName = BuilderUtils . getAttributeName ( fieldName , annot ) ; final AttributeConfiguration config = BuilderUtils . getAttributeConfiguration ( type , getter , setter , annot , attributeName ) ; AttributePropertiesImpl props = BuilderUtils . getAttributeProperties ( method , attributeName , config . getScalarType ( ) ) ; props = BuilderUtils . setEnumLabelProperty ( type , props ) ; config . setAttributeProperties ( props ) ; final AttributeImpl attr = new AttributeImpl ( new ReflectAttributeBehavior ( config , target , getter , setter ) , device . getName ( ) ) ; configureStateMachine ( setter , getter , attr ) ; logger . debug ( "Has an attribute: {} {}" , attr . getName ( ) , attr . getFormat ( ) . value ( ) ) ; device . addAttribute ( attr ) ; xlogger . exit ( ) ; |
public class CmsAddDialogTypeHelper { /** * Precomputes type lists for multiple views . < p >
* @ param cms the CMS context
* @ param folderRootPath the current folder
* @ param checkViewableReferenceUri the reference uri to use for viewability check
* @ param views the views for which to generate the type lists
* @ param check object to check whether resource types should be enabled */
public void precomputeTypeLists ( CmsObject cms , String folderRootPath , String checkViewableReferenceUri , List < CmsElementView > views , I_CmsResourceTypeEnabledCheck check ) { } } | Multimap < CmsUUID , CmsResourceTypeBean > result = ArrayListMultimap . create ( ) ; // Sort list to make sure that ' Other types ' view is processed last , because we may need to display
// types filtered / removed from other views , which we only know once we have processed these views
Collections . sort ( views , new Comparator < CmsElementView > ( ) { public int compare ( CmsElementView view0 , CmsElementView view1 ) { return ComparisonChain . start ( ) . compareFalseFirst ( view0 . isOther ( ) , view1 . isOther ( ) ) . result ( ) ; } } ) ; for ( CmsElementView view : views ) { try { result . putAll ( view . getId ( ) , getResourceTypes ( cms , folderRootPath , checkViewableReferenceUri , view , check ) ) ; } catch ( Exception e ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } } m_cachedTypes = result ; |
public class PropertyGet { /** * Visits this node , the target expression , and the property name . */
@ Override public void visit ( NodeVisitor v ) { } } | if ( v . visit ( this ) ) { getTarget ( ) . visit ( v ) ; getProperty ( ) . visit ( v ) ; } |
public class CmsToolManager { /** * Returns the OpenCms link for the given tool path which requires parameters . < p >
* Please note : Don ' t overuse the parameter map because this will likely introduce issues
* with encoding . If possible , don ' t pass parameters at all , or only very simple parameters
* with no special chars that can easily be parsed . < p >
* @ param jsp the jsp action element
* @ param toolPath the tool path
* @ param params the map of required tool parameters
* @ return the OpenCms link for the given tool path which requires parameters */
public static String linkForToolPath ( CmsJspActionElement jsp , String toolPath , Map < String , String [ ] > params ) { } } | if ( params == null ) { // no parameters - take the shortcut
return linkForToolPath ( jsp , toolPath ) ; } params . put ( CmsToolDialog . PARAM_PATH , new String [ ] { toolPath } ) ; return CmsRequestUtil . appendParameters ( jsp . link ( VIEW_JSPPAGE_LOCATION ) , params , true ) ; |
public class StatementBuilder { /** * Prepare our statement for the subclasses .
* @ param limit
* Limit for queries . Can be null if none . */
protected MappedPreparedStmt < T , ID > prepareStatement ( Long limit , boolean cacheStore ) throws SQLException { } } | List < ArgumentHolder > argList = new ArrayList < ArgumentHolder > ( ) ; String statement = buildStatementString ( argList ) ; ArgumentHolder [ ] selectArgs = argList . toArray ( new ArgumentHolder [ argList . size ( ) ] ) ; FieldType [ ] resultFieldTypes = getResultFieldTypes ( ) ; FieldType [ ] argFieldTypes = new FieldType [ argList . size ( ) ] ; for ( int selectC = 0 ; selectC < selectArgs . length ; selectC ++ ) { argFieldTypes [ selectC ] = selectArgs [ selectC ] . getFieldType ( ) ; } if ( ! type . isOkForStatementBuilder ( ) ) { throw new IllegalStateException ( "Building a statement from a " + type + " statement is not allowed" ) ; } return new MappedPreparedStmt < T , ID > ( dao , tableInfo , statement , argFieldTypes , resultFieldTypes , selectArgs , ( databaseType . isLimitSqlSupported ( ) ? null : limit ) , type , cacheStore ) ; |
public class FastDateFormat { /** * < p > Gets a formatter instance using the specified pattern , time zone
* and locale . < / p >
* @ param pattern { @ link java . text . SimpleDateFormat } compatible
* pattern
* @ param timeZone optional time zone , overrides time zone of
* formatted date
* @ param locale optional locale , overrides system locale
* @ return a pattern based date / time formatter
* @ throws IllegalArgumentException if pattern is invalid
* or < code > null < / code > */
public static synchronized FastDateFormat getInstance ( String pattern , TimeZone timeZone , Locale locale ) { } } | FastDateFormat emptyFormat = new FastDateFormat ( pattern , timeZone , locale ) ; FastDateFormat format = ( FastDateFormat ) cInstanceCache . get ( emptyFormat ) ; if ( format == null ) { format = emptyFormat ; format . init ( ) ; // convert shell format into usable one
cInstanceCache . put ( format , format ) ; // this is OK !
} return format ; |
public class RaAuthenticationMechanism { /** * Set the authentication mechanism type
* @ param the authentication mechanism type */
@ XmlElement ( name = "authentication-mechanism-type" , required = true ) public void setAuthenticationMechanismType ( String authMech ) { } } | AuthenticationMechanismType type = AuthenticationMechanismType . valueOf ( authMech ) ; authenticationMechanismType = type . name ( ) ; |
public class Throttle { /** * Used for testing . */
public static void main ( String [ ] args ) { } } | // set up a throttle for 5 ops per 10 seconds
Throttle throttle = new Throttle ( 5 , 10000 ) ; // try doing one operation per second and we should hit the throttle on the sixth operation
// and then kick in again on the eleventh , only to stop again on the fifteenth
for ( int i = 0 ; i < 20 ; i ++ ) { System . out . println ( ( i + 1 ) + ". Throttle: " + throttle . throttleOp ( ) ) ; // pause for a sec
try { Thread . sleep ( 1000L ) ; } catch ( InterruptedException ie ) { } } |
public class UploadDocumentsResult { /** * Any warnings returned by the document service about the documents being uploaded .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setWarnings ( java . util . Collection ) } or { @ link # withWarnings ( java . util . Collection ) } if you want to override
* the existing values .
* @ param warnings
* Any warnings returned by the document service about the documents being uploaded .
* @ return Returns a reference to this object so that method calls can be chained together . */
public UploadDocumentsResult withWarnings ( DocumentServiceWarning ... warnings ) { } } | if ( this . warnings == null ) { setWarnings ( new com . amazonaws . internal . SdkInternalList < DocumentServiceWarning > ( warnings . length ) ) ; } for ( DocumentServiceWarning ele : warnings ) { this . warnings . add ( ele ) ; } return this ; |
public class SliceDictionaryStreamReader { /** * Reads dictionary into data and offsetVector */
private static void readDictionary ( @ Nullable ByteArrayInputStream dictionaryDataStream , int dictionarySize , int [ ] dictionaryLengthVector , int offsetVectorOffset , byte [ ] data , int [ ] offsetVector , Type type ) throws IOException { } } | Slice slice = wrappedBuffer ( data ) ; // initialize the offset if necessary ;
// otherwise , use the previous offset
if ( offsetVectorOffset == 0 ) { offsetVector [ 0 ] = 0 ; } // truncate string and update offsets
for ( int i = 0 ; i < dictionarySize ; i ++ ) { int offsetIndex = offsetVectorOffset + i ; int offset = offsetVector [ offsetIndex ] ; int length = dictionaryLengthVector [ i ] ; int truncatedLength ; int maxCodePointCount = getMaxCodePointCount ( type ) ; boolean isCharType = isCharType ( type ) ; if ( length > 0 ) { // read data without truncation
dictionaryDataStream . next ( data , offset , offset + length ) ; // adjust offsets with truncated length
truncatedLength = computeTruncatedLength ( slice , offset , length , maxCodePointCount , isCharType ) ; verify ( truncatedLength >= 0 ) ; } else { truncatedLength = 0 ; } offsetVector [ offsetIndex + 1 ] = offsetVector [ offsetIndex ] + truncatedLength ; } |
public class KeyVaultClientBaseImpl { /** * Lists the deleted keys in the specified vault .
* Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key . This operation includes deletion - specific information . The Get Deleted Keys operation is applicable for vaults enabled for soft - delete . While the operation can be invoked on any vault , it will return an error if invoked on a non soft - delete enabled vault . This operation requires the keys / list permission .
* @ param vaultBaseUrl The vault name , for example https : / / myvault . vault . azure . net .
* @ param maxresults Maximum number of results to return in a page . If not specified the service will return up to 25 results .
* @ 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 < DeletedKeyItem > > getDeletedKeysAsync ( final String vaultBaseUrl , final Integer maxresults , final ListOperationCallback < DeletedKeyItem > serviceCallback ) { } } | return AzureServiceFuture . fromPageResponse ( getDeletedKeysSinglePageAsync ( vaultBaseUrl , maxresults ) , new Func1 < String , Observable < ServiceResponse < Page < DeletedKeyItem > > > > ( ) { @ Override public Observable < ServiceResponse < Page < DeletedKeyItem > > > call ( String nextPageLink ) { return getDeletedKeysNextSinglePageAsync ( nextPageLink ) ; } } , serviceCallback ) ; |
public class CmsDatabaseExportDialog { /** * Returns the present export files on the server to show in the combo box . < p >
* The result list elements are of type < code > { @ link org . opencms . widgets . CmsSelectWidgetOption } < / code > . < p >
* @ return the present export files on the server to show in the combo box */
protected List getComboExportFiles ( ) { } } | List result = new ArrayList ( 8 ) ; Iterator i = CmsDatabaseImportFromServer . getFileListFromServer ( true ) . iterator ( ) ; while ( i . hasNext ( ) ) { String fileName = ( String ) i . next ( ) ; String helpText = key ( Messages . GUI_EDITOR_HELP_EXPORTFILE_1 , new String [ ] { fileName } ) ; result . add ( new CmsSelectWidgetOption ( fileName , false , null , helpText ) ) ; } return result ; |
public class Tag { /** * Gets the tag value description .
* @ param encodedValue the encoded value
* @ return the tag value description */
public String getTextDescription ( String encodedValue ) { } } | if ( forceDescription != null ) { return forceDescription ; } String desc = null ; if ( tagValueDescriptions . containsKey ( encodedValue ) ) { desc = tagValueDescriptions . get ( encodedValue ) ; } return desc ; |
public class WorkspacePersistentDataManager { /** * Tell if the path is jcr : system descendant .
* @ param path
* path to check
* @ return boolean result , true if yes - it ' s jcr : system tree path */
private boolean isSystemDescendant ( QPath path ) { } } | return path . isDescendantOf ( Constants . JCR_SYSTEM_PATH ) || path . equals ( Constants . JCR_SYSTEM_PATH ) ; |
public class GeoCodeBasic { /** * { @ inheritDoc } */
@ Override public final GeoCodeItem find ( final String placeName , final String modernPlaceName ) { } } | if ( modernPlaceName == null || modernPlaceName . isEmpty ( ) ) { return find ( placeName ) ; } logger . debug ( "find(\"" + placeName + "\", \"" + modernPlaceName + "\")" ) ; final GeoDocument geoDocument = getDocument ( placeName ) ; if ( geoDocument != null ) { // We found one .
if ( modernPlaceName . equals ( geoDocument . getModernName ( ) ) ) { // Modern name matches existing , so we don ' t have a change .
if ( geoDocument . getResult ( ) == null ) { return modernWithNoResult ( placeName , modernPlaceName , geoDocument ) ; } else { // Fully formed return it .
return geoDocument . getGeoItem ( ) ; } } else { // Modern place names don ' t match , replace .
// No result , try to get .
final GeocodingResult [ ] results = geoCoder . geocode ( modernPlaceName ) ; if ( results . length == 0 ) { return noModernResult ( placeName , modernPlaceName ) ; } else { return newModernResult ( placeName , modernPlaceName , results ) ; } } } GeoCodeItem gcce ; // Not found in cache . Let ' s see what we can find .
final GeocodingResult [ ] results = geoCoder . geocode ( modernPlaceName ) ; if ( results . length > 0 ) { /* Work with the first result . */
gcce = new GeoCodeItem ( placeName , modernPlaceName , results [ 0 ] ) ; } else { // Not found , create empty .
gcce = new GeoCodeItem ( placeName , modernPlaceName ) ; } add ( gcce ) ; return gcce ; |
public class UserSettingRepository { /** * region > helpers */
private UserSettingJdo newSetting ( final String user , final String key , final String description , final SettingType settingType , final String valueRaw ) { } } | final UserSettingJdo setting = repositoryService . instantiate ( UserSettingJdo . class ) ; setting . setUser ( user ) ; setting . setKey ( key ) ; setting . setType ( settingType ) ; setting . setDescription ( description ) ; setting . setValueRaw ( valueRaw ) ; repositoryService . persist ( setting ) ; return setting ; |
public class ConsulUtils { /** * get path of url from service id in consul
* @ param serviceId service id
* @ return path */
public static String getPathFromServiceId ( String serviceId ) { } } | return serviceId . substring ( serviceId . indexOf ( ":" ) + 1 , serviceId . lastIndexOf ( ":" ) ) ; |
public class MaterialDatePicker { /** * Set the pickers date . */
public void setPickerDate ( JsDate date , Element picker ) { } } | try { $ ( picker ) . pickadate ( "picker" ) . set ( "select" , date , ( ) -> { DOM . createFieldSet ( ) . setPropertyObject ( "muted" , true ) ; } ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } |
public class OtpEpmd { /** * this function will get an exception if it tries to talk to a very old
* epmd , or if something else happens that it cannot forsee . In both cases
* we return an exception . We no longer support r3 , so the exception is
* fatal . If we manage to successfully communicate with an r4 epmd , we
* return either the socket , or null , depending on the result . */
private static OtpTransport r4_publish ( final OtpLocalNode node ) throws IOException { } } | OtpTransport s = null ; try { @ SuppressWarnings ( "resource" ) final OtpOutputStream obuf = new OtpOutputStream ( ) ; s = node . createTransport ( ( String ) null , EpmdPort . get ( ) ) ; obuf . write2BE ( node . alive ( ) . length ( ) + 13 ) ; obuf . write1 ( publish4req ) ; obuf . write2BE ( node . port ( ) ) ; obuf . write1 ( node . type ( ) ) ; obuf . write1 ( node . proto ( ) ) ; obuf . write2BE ( node . distHigh ( ) ) ; obuf . write2BE ( node . distLow ( ) ) ; obuf . write2BE ( node . alive ( ) . length ( ) ) ; obuf . writeN ( node . alive ( ) . getBytes ( ) ) ; obuf . write2BE ( 0 ) ; // No extra
// send request
obuf . writeToAndFlush ( s . getOutputStream ( ) ) ; if ( traceLevel >= traceThreshold ) { System . out . println ( "-> PUBLISH (r4) " + node + " port=" + node . port ( ) ) ; } // get reply
final byte [ ] tmpbuf = new byte [ 100 ] ; final int n = s . getInputStream ( ) . read ( tmpbuf ) ; if ( n < 0 ) { s . close ( ) ; throw new IOException ( "Nameserver not responding on " + node . host ( ) + " when publishing " + node . alive ( ) ) ; } @ SuppressWarnings ( "resource" ) final OtpInputStream ibuf = new OtpInputStream ( tmpbuf , 0 ) ; final int response = ibuf . read1 ( ) ; if ( response == publish4resp ) { final int result = ibuf . read1 ( ) ; if ( result == 0 ) { node . creation = ibuf . read2BE ( ) ; if ( traceLevel >= traceThreshold ) { System . out . println ( "<- OK" ) ; } return s ; // success
} } } catch ( final IOException e ) { // epmd closed the connection = fail
if ( s != null ) { s . close ( ) ; } if ( traceLevel >= traceThreshold ) { System . out . println ( "<- (no response)" ) ; } throw new IOException ( "Nameserver not responding on " + node . host ( ) + " when publishing " + node . alive ( ) ) ; } catch ( final OtpErlangDecodeException e ) { s . close ( ) ; if ( traceLevel >= traceThreshold ) { System . out . println ( "<- (invalid response)" ) ; } throw new IOException ( "Nameserver not responding on " + node . host ( ) + " when publishing " + node . alive ( ) ) ; } s . close ( ) ; return null ; |
public class CmsPublishEngine { /** * Enqueues a new publish job with the given information in publish queue . < p >
* All resources should already be locked . < p >
* If possible , the publish job starts immediately . < p >
* @ param cms the cms context to publish for
* @ param publishList the resources to publish
* @ param report the report to write to
* @ throws CmsException if something goes wrong while cloning the cms context */
public void enqueuePublishJob ( CmsObject cms , CmsPublishList publishList , I_CmsReport report ) throws CmsException { } } | // check the driver manager
if ( ( m_driverManager == null ) || ( m_dbContextFactory == null ) ) { // the resources are unlocked in the driver manager
throw new CmsPublishException ( Messages . get ( ) . container ( Messages . ERR_PUBLISH_ENGINE_NOT_INITIALIZED_0 ) ) ; } // prevent new jobs if the engine is disabled
if ( m_shuttingDown || ( ! isEnabled ( ) && ! OpenCms . getRoleManager ( ) . hasRole ( cms , CmsRole . ROOT_ADMIN ) ) ) { // the resources are unlocked in the driver manager
throw new CmsPublishException ( Messages . get ( ) . container ( Messages . ERR_PUBLISH_ENGINE_DISABLED_0 ) ) ; } // create the publish job
CmsPublishJobInfoBean publishJob = new CmsPublishJobInfoBean ( cms , publishList , report ) ; try { // enqueue it and
m_publishQueue . add ( publishJob ) ; // notify all listeners
m_listeners . fireEnqueued ( new CmsPublishJobBase ( publishJob ) ) ; } catch ( Throwable t ) { // we really really need to catch everything here , or else the queue status is broken
if ( m_publishQueue . contains ( publishJob ) ) { m_publishQueue . remove ( publishJob ) ; } // throw the exception again
throw new CmsException ( Messages . get ( ) . container ( Messages . ERR_PUBLISH_ENGINE_QUEUE_1 , publishJob . getPublishHistoryId ( ) ) , t ) ; } // try to start the publish job immediately
checkCurrentPublishJobThread ( ) ; |
public class TemplateElementField { /** * Gets the fieldMedia value for this TemplateElementField .
* @ return fieldMedia * Media value for non - text field types . Null if a text field .
* This
* fields must be specified if fieldText is null . */
public com . google . api . ads . adwords . axis . v201809 . cm . Media getFieldMedia ( ) { } } | return fieldMedia ; |
public class OmemoService { /** * Refresh and merge device list of contact .
* @ param connection authenticated XMPP connection
* @ param userDevice our OmemoDevice
* @ param contact contact we want to fetch the deviceList from
* @ return cached device list after refresh .
* @ throws InterruptedException
* @ throws PubSubException . NotALeafNodeException
* @ throws XMPPException . XMPPErrorException
* @ throws SmackException . NotConnectedException
* @ throws SmackException . NoResponseException */
OmemoCachedDeviceList refreshDeviceList ( XMPPConnection connection , OmemoDevice userDevice , BareJid contact ) throws InterruptedException , PubSubException . NotALeafNodeException , XMPPException . XMPPErrorException , SmackException . NotConnectedException , SmackException . NoResponseException { } } | // refreshOmemoDeviceList ;
OmemoDeviceListElement publishedList ; try { publishedList = fetchDeviceList ( connection , contact ) ; } catch ( PubSubException . NotAPubSubNodeException e ) { LOGGER . log ( Level . WARNING , "Error refreshing deviceList: " , e ) ; publishedList = null ; } if ( publishedList == null ) { publishedList = new OmemoDeviceListElement_VAxolotl ( Collections . < Integer > emptySet ( ) ) ; } return getOmemoStoreBackend ( ) . mergeCachedDeviceList ( userDevice , contact , publishedList ) ; |
public class LayoutGridScreen { /** * Add button ( s ) to the toolbar . */
public void addToolbarButtons ( ToolScreen toolScreen ) { } } | new SCannedBox ( toolScreen . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . SET_ANCHOR ) , toolScreen , null , ScreenConstants . DEFAULT_DISPLAY , null , MenuConstants . FORMDETAIL , MenuConstants . FORMDETAIL , MenuConstants . FORMDETAIL , null ) ; new SCannedBox ( toolScreen . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . SET_ANCHOR ) , toolScreen , null , ScreenConstants . DEFAULT_DISPLAY , null , MenuConstants . PRINT , MenuConstants . PRINT , MenuConstants . PRINT , null ) ; |
public class OfflineDataUploadError { /** * Gets the reason value for this OfflineDataUploadError .
* @ return reason */
public com . google . api . ads . adwords . axis . v201809 . rm . OfflineDataUploadErrorReason getReason ( ) { } } | return reason ; |
public class VirtualConnectionImpl { /** * @ see VirtualConnection # requestPermissionToFinishRead ( ) */
@ Override public boolean requestPermissionToFinishRead ( ) { } } | boolean rc = true ; synchronized ( this ) { if ( ( currentState & FINISH_NOT_ALLOWED_MASK ) != 0 ) { rc = false ; } else { currentState = ( currentState | READ_FINISHING ) & READ_FINISHING_CLEAR_OUT ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "requestPermissionToFinishRead returning " + rc ) ; } return rc ; |
public class LPPrimalDualMethod { /** * Computes the term Grad [ fi ] . stepX */
protected DoubleMatrix1D gradFiStepX ( DoubleMatrix1D stepX ) { } } | DoubleMatrix1D ret = F1 . make ( getMieq ( ) ) ; for ( int i = 0 ; i < getDim ( ) ; i ++ ) { ret . setQuick ( i , - stepX . getQuick ( i ) ) ; ret . setQuick ( getDim ( ) + i , stepX . getQuick ( i ) ) ; } return ret ; |
public class RegistrationManagerImpl { /** * { @ inheritDoc } */
@ Override public void unregisterService ( String serviceName , String providerAddress ) throws ServiceException { } } | ServiceInstanceUtils . validateManagerIsStarted ( isStarted . get ( ) ) ; ServiceInstanceUtils . validateServiceName ( serviceName ) ; ServiceInstanceUtils . validateAddress ( providerAddress ) ; getRegistrationService ( ) . unregisterService ( serviceName , providerAddress ) ; |
public class AnnotationManager { /** * Construct label for all { @ link ru . yandex . qatools . allure . annotations . Features } annotations
* using { @ link ru . yandex . qatools . allure . config . AllureModelUtils # createFeatureLabel ( String ) }
* @ return { @ link java . util . List } of created labels */
public List < Label > getFeatureLabels ( ) { } } | if ( ! isAnnotationPresent ( Features . class ) ) { return Collections . emptyList ( ) ; } List < Label > result = new ArrayList < > ( ) ; for ( String feature : getAnnotation ( Features . class ) . value ( ) ) { result . add ( createFeatureLabel ( feature ) ) ; } return result ; |
public class VMCommandLine { /** * Replies a binary executable filename depending of the current platform .
* @ param name is the name which must be converted into a binary executable filename .
* @ return the binary executable filename . */
@ Pure public static String getExecutableFilename ( String name ) { } } | if ( OperatingSystem . WIN . isCurrentOS ( ) ) { return name + ".exe" ; // $ NON - NLS - 1 $
} return name ; |
public class BccClient { /** * Modifying the password of the instance .
* You can reboot the instance only when the instance is Running or Stopped ,
* otherwise , it ' s will get < code > 409 < / code > errorCode .
* This is an asynchronous interface ,
* you can get the latest status by invoke { @ link # getInstance ( GetInstanceRequest ) }
* @ param request The request containing all options for modifying the instance password .
* @ throws BceClientException */
public void modifyInstancePassword ( ModifyInstancePasswordRequest request ) throws BceClientException { } } | checkNotNull ( request , "request should not be null." ) ; checkStringNotEmpty ( request . getInstanceId ( ) , "request instanceId should not be empty." ) ; checkStringNotEmpty ( request . getAdminPass ( ) , "request adminPass should not be empty." ) ; InternalRequest internalRequest = this . createRequest ( request , HttpMethodName . PUT , INSTANCE_PREFIX , request . getInstanceId ( ) ) ; internalRequest . addParameter ( InstanceAction . changePass . name ( ) , null ) ; BceCredentials credentials = config . getCredentials ( ) ; if ( internalRequest . getCredentials ( ) != null ) { credentials = internalRequest . getCredentials ( ) ; } try { request . setAdminPass ( this . aes128WithFirst16Char ( request . getAdminPass ( ) , credentials . getSecretKey ( ) ) ) ; } catch ( GeneralSecurityException e ) { throw new BceClientException ( "Encryption procedure exception" , e ) ; } fillPayload ( internalRequest , request ) ; this . invokeHttpClient ( internalRequest , AbstractBceResponse . class ) ; |
public class CmsGlobalForm { /** * Set up of combo box for default uri . < p >
* @ param allSites alls available sites */
private void setUpDefaultUriComboBox ( List < CmsSite > allSites ) { } } | BeanItemContainer < CmsSite > objects = new BeanItemContainer < CmsSite > ( CmsSite . class , allSites ) ; m_fieldDefaultURI . setContainerDataSource ( objects ) ; m_fieldDefaultURI . setNullSelectionAllowed ( false ) ; m_fieldDefaultURI . setTextInputAllowed ( false ) ; m_fieldDefaultURI . setItemCaptionPropertyId ( "title" ) ; // set value
String siteRoot = OpenCms . getSiteManager ( ) . getDefaultUri ( ) ; if ( siteRoot . endsWith ( "/" ) ) { siteRoot = siteRoot . substring ( 0 , siteRoot . length ( ) - 1 ) ; } CmsSite site = OpenCms . getSiteManager ( ) . getSiteForSiteRoot ( siteRoot ) ; m_fieldDefaultURI . setValue ( site ) ; |
public class RateBasedRuleMarshaller { /** * Marshall the given parameter object . */
public void marshall ( RateBasedRule rateBasedRule , ProtocolMarshaller protocolMarshaller ) { } } | if ( rateBasedRule == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( rateBasedRule . getRuleId ( ) , RULEID_BINDING ) ; protocolMarshaller . marshall ( rateBasedRule . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( rateBasedRule . getMetricName ( ) , METRICNAME_BINDING ) ; protocolMarshaller . marshall ( rateBasedRule . getMatchPredicates ( ) , MATCHPREDICATES_BINDING ) ; protocolMarshaller . marshall ( rateBasedRule . getRateKey ( ) , RATEKEY_BINDING ) ; protocolMarshaller . marshall ( rateBasedRule . getRateLimit ( ) , RATELIMIT_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link AbstractTopoPrimitiveType } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link AbstractTopoPrimitiveType } { @ code > } */
@ XmlElementDecl ( namespace = "http://www.opengis.net/gml" , name = "_TopoPrimitive" , substitutionHeadNamespace = "http://www.opengis.net/gml" , substitutionHeadName = "_Topology" ) public JAXBElement < AbstractTopoPrimitiveType > create_TopoPrimitive ( AbstractTopoPrimitiveType value ) { } } | return new JAXBElement < AbstractTopoPrimitiveType > ( __TopoPrimitive_QNAME , AbstractTopoPrimitiveType . class , null , value ) ; |
public class RestfulServer { /** * Unregister one provider ( either a Resource provider or a plain provider ) */
public void unregisterProvider ( Object provider ) { } } | if ( provider != null ) { Collection < Object > providerList = new ArrayList < > ( 1 ) ; providerList . add ( provider ) ; unregisterProviders ( providerList ) ; } |
public class LongPollingMessagingDelegate { /** * Posts a message to a long polling channel .
* @ param ccid
* the identifier of the long polling channel
* @ param serializedMessage
* the message to send serialized as a SMRF message
* @ return the path segment for the message status . The path , appended to
* the base URI of the messaging service , can be used to query the
* message status
* @ throws JoynrHttpException
* if one of :
* < ul >
* < li > ccid is not set < / li >
* < li > the message has expired or not expiry date is set < / li >
* < li > no channel registered for ccid < / li >
* < / ul > */
public String postMessage ( String ccid , byte [ ] serializedMessage ) { } } | ImmutableMessage message ; try { message = new ImmutableMessage ( serializedMessage ) ; } catch ( EncodingException | UnsuppportedVersionException e ) { throw new JoynrHttpException ( Status . BAD_REQUEST , JOYNRMESSAGINGERROR_DESERIALIZATIONFAILED ) ; } if ( ccid == null ) { log . error ( "POST message {} to cluster controller: NULL. Dropped because: channel Id was not set." , message . getId ( ) ) ; throw new JoynrHttpException ( Status . BAD_REQUEST , JOYNRMESSAGINGERROR_CHANNELNOTSET ) ; } // send the message to the receiver .
if ( message . getTtlMs ( ) == 0 ) { log . error ( "POST message {} to cluster controller: {} dropped because: expiry date not set" , ccid , message . getId ( ) ) ; throw new JoynrHttpException ( Status . BAD_REQUEST , JOYNRMESSAGINGERROR_EXPIRYDATENOTSET ) ; } // Relative TTLs are not supported yet .
if ( ! message . isTtlAbsolute ( ) ) { throw new JoynrHttpException ( Status . BAD_REQUEST , JOYNRMESSAGINGERROR_RELATIVE_TTL_UNSPORTED ) ; } if ( message . getTtlMs ( ) < System . currentTimeMillis ( ) ) { log . warn ( "POST message {} to cluster controller: {} dropped because: TTL expired" , ccid , message . getId ( ) ) ; throw new JoynrHttpException ( Status . BAD_REQUEST , JOYNRMESSAGINGERROR_EXPIRYDATEEXPIRED ) ; } // look for an existing broadcaster
Broadcaster ccBroadcaster = BroadcasterFactory . getDefault ( ) . lookup ( Broadcaster . class , ccid , false ) ; if ( ccBroadcaster == null ) { // if the receiver has never registered with the bounceproxy
// ( or his registration has expired ) then return 204 no
// content .
log . error ( "POST message {} to cluster controller: {} dropped because: no channel found" , ccid , message . getId ( ) ) ; throw new JoynrHttpException ( Status . BAD_REQUEST , JOYNRMESSAGINGERROR_CHANNELNOTFOUND ) ; } if ( ccBroadcaster . getAtmosphereResources ( ) . size ( ) == 0 ) { log . debug ( "no poll currently waiting for channelId: {}" , ccid ) ; } ccBroadcaster . broadcast ( message ) ; return "messages/" + message . getId ( ) ; |
public class I18NUtils { /** * Looks up the value for < code > key < / code > in the
* < code > ResourceBundle < / code > referenced by
* < code > bundleName < / code > , then formats that value for the
* specified < code > Locale < / code > using < code > args < / code > .
* @ return Localized , formatted text identified by
* < code > key < / code > . */
public static String format ( String bundleName , Locale locale , String key , Object [ ] args ) { } } | if ( locale == null ) { // When formatting Date objects and such , MessageFormat
// cannot have a null Locale .
locale = Locale . getDefault ( ) ; } String value = getString ( bundleName , locale , key ) ; if ( args == null ) { args = NO_ARGS ; } // FIXME : after switching to JDK 1.4 , it will be possible to clean
// this up by providing the Locale along with the string in the
// constructor to MessageFormat . Until 1.4 , the following workaround
// is required for constructing the format with the appropriate locale :
MessageFormat messageFormat = new MessageFormat ( "" ) ; messageFormat . setLocale ( locale ) ; messageFormat . applyPattern ( value ) ; return messageFormat . format ( args ) ; |
public class TemplateSignatureRequest { /** * Adds the value to fill in for a custom field with the given field name .
* @ param fieldNameOrApiId String name ( or " Field Label " ) of the custom field
* to be filled in . The " api _ id " can also be used instead of the name .
* @ param value String value */
public void setCustomFieldValue ( String fieldNameOrApiId , String value ) { } } | CustomField f = new CustomField ( ) ; f . setName ( fieldNameOrApiId ) ; f . setValue ( value ) ; customFields . add ( f ) ; |
public class AvailabilityZone { /** * @ param supportedPlatforms */
public void setSupportedPlatforms ( java . util . Collection < SupportedPlatform > supportedPlatforms ) { } } | if ( supportedPlatforms == null ) { this . supportedPlatforms = null ; return ; } this . supportedPlatforms = new com . amazonaws . internal . SdkInternalList < SupportedPlatform > ( supportedPlatforms ) ; |
public class PreservingHttpHeaderProcessor { /** * prefix prepended to the name of headers preserved .
* < p > Example : " { @ code X - Archive - Orig - } " .
* Empty String is translated to { @ code null } .
* Default value is { @ code null } . < / p >
* @ param prefix header name prefix */
public void setPrefix ( String prefix ) { } } | this . prefix = prefix ; if ( this . prefix != null && this . prefix . isEmpty ( ) ) this . prefix = null ; |
public class Extract { /** * Add more primary keys to the existing set of primary keys .
* @ param primaryKeyFieldName primary key names
* @ deprecated @ deprecated It is recommended to add primary keys in { @ code WorkUnit } instead of { @ code Extract } . */
@ Deprecated public void addPrimaryKey ( String ... primaryKeyFieldName ) { } } | StringBuilder sb = new StringBuilder ( getProp ( ConfigurationKeys . EXTRACT_PRIMARY_KEY_FIELDS_KEY , "" ) ) ; Joiner . on ( "," ) . appendTo ( sb , primaryKeyFieldName ) ; setProp ( ConfigurationKeys . EXTRACT_PRIMARY_KEY_FIELDS_KEY , sb . toString ( ) ) ; |
public class TableFactorBuilder { /** * Sets the weight of { @ code a } to { @ code weight } in the table factor returned
* by { @ link # build ( ) } . If { @ code a } has already been associated with a weight
* in { @ code this } builder , this call overwrites the old weight . If
* { @ code weight } is 0.0 , { @ code a } is deleted from this builder . */
public void setWeight ( Assignment a , double weight ) { } } | Preconditions . checkArgument ( a . containsAll ( vars . getVariableNumsArray ( ) ) ) ; weightBuilder . put ( vars . assignmentToIntArray ( a ) , weight ) ; |
public class Tree { /** * Remove the node from children
* @ param node
* @ return has removed */
public boolean remove ( Tree < T > node ) { } } | return getChild ( node ) . map ( function ( n -> n . parent = null ) ) . map ( children :: remove ) . orElse ( false ) ; |
public class CmsExternalLayout { /** * This is overridden so that { @ link # setWidget ( Widget ) } uses the specified
* external element . */
@ Override @ SuppressWarnings ( "deprecation" ) // have to use old Element here because of superclass
protected com . google . gwt . user . client . Element getContainerElement ( ) { } } | return DOM . asOld ( getRenderTargetElement ( ) ) ; |
public class DirectoryResourceImpl { /** * Using the given type , obtain a reference to the child resource of the given type . If the result is not of the
* requested type and does not exist , return null . If the result is not of the requested type and exists , throw
* { @ link ResourceException } */
@ Override @ SuppressWarnings ( "unchecked" ) public < E , T extends Resource < E > > T getChildOfType ( final Class < T > type , final String name ) throws ResourceException { } } | T result ; Resource < ? > child = getChild ( name ) ; if ( type . isAssignableFrom ( child . getClass ( ) ) ) { result = ( T ) child ; } else if ( child . exists ( ) ) { throw new ResourceException ( "Requested resource [" + name + "] was not of type [" + type . getName ( ) + "], but was instead [" + child . getClass ( ) . getName ( ) + "]" ) ; } else { E underlyingResource = ( E ) child . getUnderlyingResourceObject ( ) ; result = getResourceFactory ( ) . create ( type , underlyingResource ) ; } return result ; |
public class Configuration { /** * Parses all target - specific settings form the main configuration file .
* @ param root The root element of the configuration . */
private final void parseTargetSpecificSettings ( final Element root ) { } } | final NodeList targets = root . getElementsByTagName ( ELEMENT_TARGET ) ; Node target ; Node parameter ; NodeList parameters ; try { for ( int i = 0 ; i < targets . getLength ( ) ; i ++ ) { target = targets . item ( i ) ; parameters = target . getChildNodes ( ) ; // extract target address and the port ( if specified )
SessionConfiguration sc = new SessionConfiguration ( ) ; sc . setAddress ( target . getAttributes ( ) . getNamedItem ( ATTRIBUTE_ADDRESS ) . getNodeValue ( ) , Integer . parseInt ( target . getAttributes ( ) . getNamedItem ( ATTRIBUTE_PORT ) . getNodeValue ( ) ) ) ; // extract the parameters for this target
for ( int j = 0 ; j < parameters . getLength ( ) ; j ++ ) { parameter = parameters . item ( j ) ; if ( parameter . getNodeType ( ) == Node . ELEMENT_NODE ) { sc . addSessionSetting ( OperationalTextKey . valueOfEx ( parameter . getNodeName ( ) ) , parameter . getTextContent ( ) ) ; } } synchronized ( sessionConfigs ) { sessionConfigs . put ( target . getAttributes ( ) . getNamedItem ( ATTRIBUTE_ID ) . getNodeValue ( ) , sc ) ; } } } catch ( UnknownHostException e ) { if ( LOGGER . isErrorEnabled ( ) ) { LOGGER . error ( "The given host is not reachable: " + e . getLocalizedMessage ( ) ) ; } } |
public class DptXlatorMeteringValue { /** * try to find the coding based on unit */
private int coding ( final String unit ) throws KNXFormatException { } } | expUnitAdjustment = 0 ; // @ formatter : off
switch ( unit ) { case "Wh" : return 0b00000000 ; case "MWh" : expUnitAdjustment = 6 ; return 0b10000000 ; case "kJ" : expUnitAdjustment = 3 ; return 0b00001000 ; case "GJ" : expUnitAdjustment = 9 ; return 0b10001000 ; case "l" : expUnitAdjustment = - 3 ; return 0b00010000 ; case "kg" : return 0b00011000 ; case "W" : return 0b00101000 ; case "MW" : expUnitAdjustment = 6 ; return 0b10101000 ; case "kJ/h" : expUnitAdjustment = 3 ; return 0b00110000 ; case "GJ/h" : expUnitAdjustment = 9 ; return 0b10110000 ; case "l/h" : expUnitAdjustment = - 3 ; return 0b00111000 ; case "l/min" : expUnitAdjustment = - 3 ; return 0b01000000 ; case "ml/s" : expUnitAdjustment = - 6 ; return 0b01001000 ; case "kg/h" : return 0b01010000 ; // case " " : return 0b01101110 ; / / ' units for HCA ' , we will opt for ' dimensionless counter '
case "" : return dimensionlessCounter ; default : throw newException ( "unsupported unit" , unit ) ; } // @ formatter : on |
public class Dependency { /** * Returns an array of String with the name of every dependency from a list of dependencies .
* @ param dependencies List of dependencies
* @ return String [ ] with all names of the dependencies */
public static String [ ] getArrayOfNames ( Map < String , Dependency > dependencies ) { } } | List < String > nameList = new LinkedList < String > ( ) ; for ( Dependency dependency : dependencies . values ( ) ) { nameList . add ( dependency . getName ( ) ) ; } return nameList . toArray ( new String [ nameList . size ( ) ] ) ; |
public class CoreStitchAuth { /** * prevent too many refreshes happening one after the other . */
private void tryRefreshAccessToken ( final Long reqStartedAt ) { } } | authLock . writeLock ( ) . lock ( ) ; try { if ( ! isLoggedIn ( ) ) { throw new StitchClientException ( StitchClientErrorCode . LOGGED_OUT_DURING_REQUEST ) ; } try { final Jwt jwt = Jwt . fromEncoded ( getAuthInfo ( ) . getAccessToken ( ) ) ; if ( jwt . getIssuedAt ( ) >= reqStartedAt ) { return ; } } catch ( final IOException e ) { // Swallow
} // retry
refreshAccessToken ( ) ; } finally { authLock . writeLock ( ) . unlock ( ) ; } |
public class GroupListHelperImpl { /** * ( non - Javadoc )
* @ see org . apereo . portal . layout . dlm . remoting . IGroupListHelper # getEntityType ( org . apereo . portal . groups . IGroupMember ) */
@ Override public EntityEnum getEntityType ( IGroupMember entity ) { } } | if ( entity == null ) { throw new IllegalArgumentException ( "Parameter must not be null" ) ; } if ( IEntityGroup . class . isAssignableFrom ( entity . getClass ( ) ) ) { return EntityEnum . getEntityEnum ( entity . getLeafType ( ) , true ) ; } else { return EntityEnum . getEntityEnum ( entity . getLeafType ( ) , false ) ; } |
public class AbstractIndex { /** * Returns an < code > IndexReader < / code > on this index . This index reader
* may be used to delete documents .
* @ return an < code > IndexReader < / code > on this index .
* @ throws IOException if the reader cannot be obtained . */
protected synchronized CommittableIndexReader getIndexReader ( ) throws IOException { } } | if ( indexWriter != null ) { indexWriter . close ( ) ; log . debug ( "closing IndexWriter." ) ; indexWriter = null ; } if ( indexReader == null || ! indexReader . isCurrent ( ) ) { IndexReader reader = IndexReader . open ( getDirectory ( ) , null , false , termInfosIndexDivisor ) ; // if modeHandler ! = null and mode = = READ _ ONLY , then reader should be with transient deletions .
// This is used to transiently update reader in clustered environment when some documents have
// been deleted . If index reader not null and already contains some transient deletions , but it
// is no more current , it will be re - created loosing deletions . They will already be applied by
// coordinator node in the cluster . And there is no need to inject them into the new reader
indexReader = new CommittableIndexReader ( reader , modeHandler != null && modeHandler . getMode ( ) == IndexerIoMode . READ_ONLY ) ; } return indexReader ; |
public class RemoteMessageRequest { /** * / * ( non - Javadoc )
* @ see com . ibm . ws . sib . processor . runtime . SIMPControllable # getName ( ) */
public String getName ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getName" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "No implementation" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getName" , null ) ; return null ; |
public class UtilizationShell { /** * Obtain the result to print in command line
* @ param argv
* @ return the response to show users
* @ throws IOException */
public String getResponse ( String [ ] argv ) throws IOException { } } | String result = "" ; if ( argv . length < 1 ) { return result ; } if ( argv [ 0 ] . equals ( "-all" ) ) { result += rpcCollector . getClusterUtilization ( ) ; result += JobUtilization . legendString + JobUtilization . unitString ; for ( JobUtilization job : rpcCollector . getAllRunningJobUtilization ( ) ) { result += job ; } result += TaskTrackerUtilization . legendString + TaskTrackerUtilization . unitString ; for ( TaskTrackerUtilization tt : rpcCollector . getAllTaskTrackerUtilization ( ) ) { result += tt ; } return result ; } if ( argv [ 0 ] . equals ( "-cluster" ) ) { result += rpcCollector . getClusterUtilization ( ) ; return result ; } if ( argv [ 0 ] . equals ( "-job" ) ) { result += JobUtilization . legendString + JobUtilization . unitString ; if ( argv . length == 1 ) { for ( JobUtilization job : rpcCollector . getAllRunningJobUtilization ( ) ) { result += job ; } return result ; } for ( int i = 1 ; i < argv . length ; i ++ ) { result += rpcCollector . getJobUtilization ( argv [ i ] ) ; } return result ; } if ( argv [ 0 ] . equals ( "-tasktracker" ) ) { result += TaskTrackerUtilization . legendString + TaskTrackerUtilization . unitString ; if ( argv . length == 1 ) { for ( TaskTrackerUtilization tt : rpcCollector . getAllTaskTrackerUtilization ( ) ) { result += tt ; } return result ; } for ( int i = 1 ; i < argv . length ; i ++ ) { result += rpcCollector . getTaskTrackerUtilization ( argv [ i ] ) ; } return result ; } return result ; |
public class LightweightTypeReference { /** * / * @ Nullable */
protected JvmType findType ( Class < ? > type ) { } } | return getServices ( ) . getTypeReferences ( ) . findDeclaredType ( type , getOwner ( ) . getContextResourceSet ( ) ) ; |
public class ChangedList { /** * Releases the reservation on the file ( if still reserved ) and returns
* it to the list .
* @ param changedFile */
synchronized void unreserve ( ChangedFile changedFile ) { } } | ChangedFile removedFile = this . reservedFiles . remove ( getKey ( changedFile ) ) ; if ( removedFile != null && ! this . fileList . containsKey ( getKey ( removedFile ) ) ) { addChangedFile ( removedFile ) ; } |
public class OperationMetadataV1 { /** * < pre >
* Time that this operation was created .
* & # 64 ; OutputOnly
* < / pre >
* < code > . google . protobuf . Timestamp insert _ time = 2 ; < / code > */
public com . google . protobuf . Timestamp getInsertTime ( ) { } } | return insertTime_ == null ? com . google . protobuf . Timestamp . getDefaultInstance ( ) : insertTime_ ; |
public class RuntimeHttpUtils { /** * Returns an URI for the given endpoint .
* Prefixes the protocol if the endpoint given does not have it .
* @ throws IllegalArgumentException if the inputs are null . */
public static URI toUri ( String endpoint , ClientConfiguration config ) { } } | if ( config == null ) { throw new IllegalArgumentException ( "ClientConfiguration cannot be null" ) ; } return toUri ( endpoint , config . getProtocol ( ) ) ; |
public class vpnglobal_vpnclientlessaccesspolicy_binding { /** * Use this API to fetch filtered set of vpnglobal _ vpnclientlessaccesspolicy _ binding resources .
* set the filter parameter values in filtervalue object . */
public static vpnglobal_vpnclientlessaccesspolicy_binding [ ] get_filtered ( nitro_service service , filtervalue [ ] filter ) throws Exception { } } | vpnglobal_vpnclientlessaccesspolicy_binding obj = new vpnglobal_vpnclientlessaccesspolicy_binding ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; vpnglobal_vpnclientlessaccesspolicy_binding [ ] response = ( vpnglobal_vpnclientlessaccesspolicy_binding [ ] ) obj . getfiltered ( service , option ) ; return response ; |
public class ProgressBar { /** * Wraps a { @ link Stream } so that when iterated , a progress bar is shown to track the traversal progress .
* @ param stream Underlying stream ( can be sequential or parallel )
* @ param task Task name */
public static < T , S extends BaseStream < T , S > > Stream < T > wrap ( S stream , String task ) { } } | ProgressBarBuilder pbb = new ProgressBarBuilder ( ) . setTaskName ( task ) ; return wrap ( stream , pbb ) ; |
public class IQ2DatalogTranslatorImpl { /** * Assumes that ORDER BY is ABOVE the first construction node */
private IQTree getFirstNonQueryModifierTree ( IQ query ) { } } | // Non - final
IQTree iqTree = query . getTree ( ) ; while ( iqTree . getRootNode ( ) instanceof QueryModifierNode ) { iqTree = ( ( UnaryIQTree ) iqTree ) . getChild ( ) ; } return iqTree ; |
public class TileBoundingBoxUtils { /** * Get the pixel x size for the bounding box with matrix width and tile
* width
* @ param webMercatorBoundingBox
* web mercator bounding box
* @ param matrixWidth
* matrix width
* @ param tileWidth
* tile width
* @ return pixel x size */
public static double getPixelXSize ( BoundingBox webMercatorBoundingBox , long matrixWidth , int tileWidth ) { } } | double pixelXSize = ( webMercatorBoundingBox . getMaxLongitude ( ) - webMercatorBoundingBox . getMinLongitude ( ) ) / matrixWidth / tileWidth ; return pixelXSize ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.