signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class LockedMessageEnumerationImpl { /** * Returns the consumer session this enumeration contains messages * delivered to . * @ see com . ibm . wsspi . sib . core . LockedMessageEnumeration # getConsumerSession ( ) */ public ConsumerSession getConsumerSession ( ) throws SISessionUnavailableException , SISessionDroppedException , SIConnectionUnavailableException , SIConnectionDroppedException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getConsumerSession" ) ; // f173765.2 checkValid ( ) ; // f173765.2 if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getConsumerSession" ) ; // f173765.2 return consumerSession ;
public class AStar { /** * Set the evaluation heuristic used by the A * algorithm . * @ param heuristic is the evaluation heuristic . * @ return the old heurisstic . */ public AStarHeuristic < ? super PT > setEvaluationHeuristic ( AStarHeuristic < ? super PT > heuristic ) { } }
final AStarHeuristic < ? super PT > old = this . heuristic ; this . heuristic = heuristic ; return old ;
public class Hpack { /** * Encodes an integer in the HPACK prefix format . * This method assumes that the buffer has already had the first 8 - n bits filled . * As such it will modify the last byte that is already present in the buffer , and * potentially add more if required * @ param source The buffer that contains the integer * @ param value The integer to encode * @ param n The encoding prefix length */ static void encodeInteger ( ByteBuffer source , int value , int n ) { } }
int twoNminus1 = PREFIX_TABLE [ n ] ; int pos = source . position ( ) - 1 ; if ( value < twoNminus1 ) { source . put ( pos , ( byte ) ( source . get ( pos ) | value ) ) ; } else { source . put ( pos , ( byte ) ( source . get ( pos ) | twoNminus1 ) ) ; value = value - twoNminus1 ; while ( value >= 128 ) { source . put ( ( byte ) ( value % 128 + 128 ) ) ; value = value / 128 ; } source . put ( ( byte ) value ) ; }
public class EbInterfaceWriter { /** * Create a writer builder for Ebi43InvoiceType . * @ return The builder and never < code > null < / code > */ @ Nonnull public static EbInterfaceWriter < Ebi43InvoiceType > ebInterface43 ( ) { } }
final EbInterfaceWriter < Ebi43InvoiceType > ret = EbInterfaceWriter . create ( Ebi43InvoiceType . class ) ; ret . setNamespaceContext ( EbInterface43NamespaceContext . getInstance ( ) ) ; return ret ;
public class IPv6AddressSection { /** * Returns whether this subnet or address has alphabetic digits when printed . * Note that this method does not indicate whether any address contained within this subnet has alphabetic digits , * only whether the subnet itself when printed has alphabetic digits . * @ return whether the section has alphabetic digits when printed . */ public boolean hasUppercaseVariations ( int base , boolean lowerOnly ) { } }
if ( base > 10 ) { int count = getSegmentCount ( ) ; for ( int i = 0 ; i < count ; i ++ ) { IPv6AddressSegment seg = getSegment ( i ) ; if ( seg . hasUppercaseVariations ( base , lowerOnly ) ) { return true ; } } } return false ;
public class SpiceManager { /** * Execute a request . Before invoking the method * { @ link SpiceRequest # loadDataFromNetwork ( ) } , the cache will be checked : * if a result has been cached with the cache key < i > requestCacheKey < / i > , * RoboSpice will consider the parameter < i > cacheExpiryDuration < / i > to * determine whether the result in the cache is expired or not . If it is not * expired , then listeners will receive the data in cache . Otherwise , the * method { @ link SpiceRequest # loadDataFromNetwork ( ) } will be invoked and the * result will be stored in cache using the cache key * < i > requestCacheKey < / i > . * @ param request * the request to execute * @ param requestCacheKey * the key used to store and retrieve the result of the request * in the cache * @ param cacheExpiryDuration * duration in milliseconds after which the content of the cache * will be considered to be expired . * { @ link DurationInMillis # ALWAYS _ RETURNED } means data in cache * is always returned if it exists . * { @ link DurationInMillis # ALWAYS _ EXPIRED } means data in cache is * never returned . ( see { @ link DurationInMillis } ) * @ param requestListener * the listener to notify when the request will finish */ public < T > void execute ( final SpiceRequest < T > request , final Object requestCacheKey , final long cacheExpiryDuration , final RequestListener < T > requestListener ) { } }
final CachedSpiceRequest < T > cachedSpiceRequest = new CachedSpiceRequest < T > ( request , requestCacheKey , cacheExpiryDuration ) ; execute ( cachedSpiceRequest , requestListener ) ;
public class IndicatorSkin { /** * * * * * * Initialization * * * * * */ private void initGraphics ( ) { } }
// Set initial size if ( Double . compare ( gauge . getPrefWidth ( ) , 0.0 ) <= 0 || Double . compare ( gauge . getPrefHeight ( ) , 0.0 ) <= 0 || Double . compare ( gauge . getWidth ( ) , 0.0 ) <= 0 || Double . compare ( gauge . getHeight ( ) , 0.0 ) <= 0 ) { if ( gauge . getPrefWidth ( ) > 0 && gauge . getPrefHeight ( ) > 0 ) { gauge . setPrefSize ( gauge . getPrefWidth ( ) , gauge . getPrefHeight ( ) ) ; } else { gauge . setPrefSize ( PREFERRED_WIDTH , PREFERRED_HEIGHT ) ; } } barBackground = new Arc ( PREFERRED_WIDTH * 0.5 , PREFERRED_HEIGHT * 0.696 , PREFERRED_WIDTH * 0.275 , PREFERRED_WIDTH * 0.275 , angleRange * 0.5 + 90 , - angleRange ) ; barBackground . setType ( ArcType . OPEN ) ; barBackground . setStroke ( gauge . getBarBackgroundColor ( ) ) ; barBackground . setStrokeWidth ( PREFERRED_WIDTH * 0.02819549 * 2 ) ; barBackground . setStrokeLineCap ( StrokeLineCap . BUTT ) ; barBackground . setFill ( null ) ; sectionLayer = new Pane ( ) ; sectionLayer . setBackground ( new Background ( new BackgroundFill ( Color . TRANSPARENT , CornerRadii . EMPTY , Insets . EMPTY ) ) ) ; bar = new Arc ( PREFERRED_WIDTH * 0.5 , PREFERRED_HEIGHT * 0.696 , PREFERRED_WIDTH * 0.275 , PREFERRED_WIDTH * 0.275 , angleRange * 0.5 + 90 , 0 ) ; bar . setType ( ArcType . OPEN ) ; bar . setStroke ( gauge . getBarColor ( ) ) ; bar . setStrokeWidth ( PREFERRED_WIDTH * 0.02819549 * 2 ) ; bar . setStrokeLineCap ( StrokeLineCap . BUTT ) ; bar . setFill ( null ) ; // bar . setMouseTransparent ( sectionsAlwaysVisible ? true : false ) ; bar . setVisible ( ! sectionsAlwaysVisible ) ; needleRotate = new Rotate ( ( gauge . getValue ( ) - oldValue - minValue ) * angleStep ) ; needleMoveTo1 = new MoveTo ( ) ; needleCubicCurveTo2 = new CubicCurveTo ( ) ; needleCubicCurveTo3 = new CubicCurveTo ( ) ; needleCubicCurveTo4 = new CubicCurveTo ( ) ; needleCubicCurveTo5 = new CubicCurveTo ( ) ; needleCubicCurveTo6 = new CubicCurveTo ( ) ; needleCubicCurveTo7 = new CubicCurveTo ( ) ; needleClosePath8 = new ClosePath ( ) ; needle = new Path ( needleMoveTo1 , needleCubicCurveTo2 , needleCubicCurveTo3 , needleCubicCurveTo4 , needleCubicCurveTo5 , needleCubicCurveTo6 , needleCubicCurveTo7 , needleClosePath8 ) ; needle . setFillRule ( FillRule . EVEN_ODD ) ; needle . getTransforms ( ) . setAll ( needleRotate ) ; needle . setFill ( gauge . getNeedleColor ( ) ) ; needle . setPickOnBounds ( false ) ; needle . setStrokeType ( StrokeType . INSIDE ) ; needle . setStrokeWidth ( 1 ) ; needle . setStroke ( gauge . getBackgroundPaint ( ) ) ; needleTooltip = new Tooltip ( String . format ( locale , formatString , gauge . getValue ( ) ) ) ; needleTooltip . setTextAlignment ( TextAlignment . CENTER ) ; Tooltip . install ( needle , needleTooltip ) ; minValueText = new Text ( String . format ( locale , "%." + gauge . getTickLabelDecimals ( ) + "f" , gauge . getMinValue ( ) ) ) ; minValueText . setFill ( gauge . getTitleColor ( ) ) ; Helper . enableNode ( minValueText , gauge . getTickLabelsVisible ( ) ) ; maxValueText = new Text ( String . format ( locale , "%." + gauge . getTickLabelDecimals ( ) + "f" , gauge . getMaxValue ( ) ) ) ; maxValueText . setFill ( gauge . getTitleColor ( ) ) ; Helper . enableNode ( maxValueText , gauge . getTickLabelsVisible ( ) ) ; titleText = new Text ( gauge . getTitle ( ) ) ; titleText . setFill ( gauge . getTitleColor ( ) ) ; Helper . enableNode ( titleText , ! gauge . getTitle ( ) . isEmpty ( ) ) ; if ( ! sections . isEmpty ( ) && sectionsVisible && ! sectionsAlwaysVisible ) { barTooltip = new Tooltip ( ) ; barTooltip . setTextAlignment ( TextAlignment . CENTER ) ; Tooltip . install ( bar , barTooltip ) ; } pane = new Pane ( barBackground , sectionLayer , bar , needle , minValueText , maxValueText , titleText ) ; pane . setBorder ( new Border ( new BorderStroke ( gauge . getBorderPaint ( ) , BorderStrokeStyle . SOLID , CornerRadii . EMPTY , new BorderWidths ( gauge . getBorderWidth ( ) ) ) ) ) ; pane . setBackground ( new Background ( new BackgroundFill ( gauge . getBackgroundPaint ( ) , CornerRadii . EMPTY , Insets . EMPTY ) ) ) ; getChildren ( ) . setAll ( pane ) ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcBoundaryNodeConditionWarping ( ) { } }
if ( ifcBoundaryNodeConditionWarpingEClass == null ) { ifcBoundaryNodeConditionWarpingEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 49 ) ; } return ifcBoundaryNodeConditionWarpingEClass ;
public class Sample { /** * Create a SampleCreator to execute create . * @ param pathAssistantSid The unique ID of the Assistant . * @ param pathTaskSid The unique ID of the Task associated with this Sample . * @ param language An ISO language - country string of the sample . * @ param taggedText The text example of how end - users may express this task . * The sample may contain Field tag blocks . * @ return SampleCreator capable of executing the create */ public static SampleCreator creator ( final String pathAssistantSid , final String pathTaskSid , final String language , final String taggedText ) { } }
return new SampleCreator ( pathAssistantSid , pathTaskSid , language , taggedText ) ;
public class DAO { /** * / * - - - - - [ Helpers ] - - - - - */ private Object [ ] values ( T record , int order [ ] ) { } }
Object args [ ] = new Object [ order . length ] ; for ( int i = 0 ; i < args . length ; i ++ ) args [ i ] = getColumnValue ( order [ i ] , record ) ; return args ;
public class SqlManagerImpl { /** * { @ inheritDoc } * @ see jp . co . future . uroborosql . store . SqlManager # existSql ( java . lang . String ) */ @ Override public boolean existSql ( final String sqlPath ) { } }
if ( ! cache ) { return sqlLoader . existSql ( sqlPath ) ; } else { return sqlMap . get ( sqlPath . replace ( "." , "/" ) ) != null ; }
public class GenMapAndTopicListModule { /** * Read a file and process it for list information . * @ param ref system path of the file to process * @ throws DITAOTException if processing failed */ private void processFile ( final Reference ref ) throws DITAOTException { } }
currentFile = ref . filename ; assert currentFile . isAbsolute ( ) ; logger . info ( "Processing " + currentFile ) ; final String [ ] params = { currentFile . toString ( ) } ; try { XMLReader xmlSource = getXmlReader ( ref . format ) ; for ( final XMLFilter f : getProcessingPipe ( currentFile ) ) { f . setParent ( xmlSource ) ; f . setEntityResolver ( CatalogUtils . getCatalogResolver ( ) ) ; xmlSource = f ; } xmlSource . setContentHandler ( nullHandler ) ; xmlSource . parse ( currentFile . toString ( ) ) ; if ( listFilter . isValidInput ( ) ) { processParseResult ( currentFile ) ; categorizeCurrentFile ( ref ) ; } else if ( ! currentFile . equals ( rootFile ) ) { logger . warn ( MessageUtils . getMessage ( "DOTJ021W" , params ) . toString ( ) ) ; failureList . add ( currentFile ) ; } } catch ( final RuntimeException e ) { throw e ; } catch ( final SAXParseException sax ) { final Exception inner = sax . getException ( ) ; if ( inner != null && inner instanceof DITAOTException ) { throw ( DITAOTException ) inner ; } if ( currentFile . equals ( rootFile ) ) { throw new DITAOTException ( MessageUtils . getMessage ( "DOTJ012F" , params ) . toString ( ) + ": " + sax . getMessage ( ) , sax ) ; } else if ( processingMode == Mode . STRICT ) { throw new DITAOTException ( MessageUtils . getMessage ( "DOTJ013E" , params ) . toString ( ) + ": " + sax . getMessage ( ) , sax ) ; } else { logger . error ( MessageUtils . getMessage ( "DOTJ013E" , params ) . toString ( ) + ": " + sax . getMessage ( ) , sax ) ; } failureList . add ( currentFile ) ; } catch ( final FileNotFoundException e ) { if ( ! exists ( currentFile ) ) { if ( currentFile . equals ( rootFile ) ) { throw new DITAOTException ( MessageUtils . getMessage ( "DOTA069F" , params ) . toString ( ) , e ) ; } else if ( processingMode == Mode . STRICT ) { throw new DITAOTException ( MessageUtils . getMessage ( "DOTX008E" , params ) . toString ( ) , e ) ; } else { logger . error ( MessageUtils . getMessage ( "DOTX008E" , params ) . toString ( ) ) ; } } else if ( currentFile . equals ( rootFile ) ) { throw new DITAOTException ( MessageUtils . getMessage ( "DOTJ078F" , params ) . toString ( ) + " Cannot load file: " + e . getMessage ( ) , e ) ; } else if ( processingMode == Mode . STRICT ) { throw new DITAOTException ( MessageUtils . getMessage ( "DOTJ079E" , params ) . toString ( ) + " Cannot load file: " + e . getMessage ( ) , e ) ; } else { logger . error ( MessageUtils . getMessage ( "DOTJ079E" , params ) . toString ( ) + " Cannot load file: " + e . getMessage ( ) ) ; } failureList . add ( currentFile ) ; } catch ( final Exception e ) { if ( currentFile . equals ( rootFile ) ) { throw new DITAOTException ( MessageUtils . getMessage ( "DOTJ012F" , params ) . toString ( ) + ": " + e . getMessage ( ) , e ) ; } else if ( processingMode == Mode . STRICT ) { throw new DITAOTException ( MessageUtils . getMessage ( "DOTJ013E" , params ) . toString ( ) + ": " + e . getMessage ( ) , e ) ; } else { logger . error ( MessageUtils . getMessage ( "DOTJ013E" , params ) . toString ( ) + ": " + e . getMessage ( ) , e ) ; } failureList . add ( currentFile ) ; } if ( ! listFilter . isValidInput ( ) && currentFile . equals ( rootFile ) ) { if ( validate ) { // stop the build if all content in the input file was filtered out . throw new DITAOTException ( MessageUtils . getMessage ( "DOTJ022F" , params ) . toString ( ) ) ; } else { // stop the build if the content of the file is not valid . throw new DITAOTException ( MessageUtils . getMessage ( "DOTJ034F" , params ) . toString ( ) ) ; } } doneList . add ( currentFile ) ; listFilter . reset ( ) ; keydefFilter . reset ( ) ;
public class FieldSet { /** * Useful for implementing * { @ link Message . Builder # setRepeatedField ( Descriptors . FieldDescriptor , int , Object ) } . */ @ SuppressWarnings ( "unchecked" ) public void setRepeatedField ( final FieldDescriptorType descriptor , final int index , final Object value ) { } }
if ( ! descriptor . isRepeated ( ) ) { throw new IllegalArgumentException ( "getRepeatedField() can only be called on repeated fields." ) ; } final Object list = getField ( descriptor ) ; if ( list == null ) { throw new IndexOutOfBoundsException ( ) ; } verifyType ( descriptor . getLiteType ( ) , value ) ; ( ( List < Object > ) list ) . set ( index , value ) ;
public class GhprbExtensionDescriptor { /** * Don ' t mutate the list from Jenkins , they will persist ; * @ return list of extensions */ private static List < GhprbExtensionDescriptor > getExtensions ( ) { } }
List < GhprbExtensionDescriptor > list = new ArrayList < GhprbExtensionDescriptor > ( ) ; list . addAll ( getExtensionList ( ) ) ; return list ;
public class SystemFunctionSet { /** * @ see org . s1 . objects . Objects # merge ( java . util . List ) * @ param args * @ return */ @ MapMethod public Map < String , Object > merge ( List < Map < String , Object > > args ) { } }
return Objects . merge ( args ) ;
public class AuthenticationApi { /** * Sign - out a logged in user * Sign - out the current user and invalidate either the current token or all tokens associated with the user . * @ param authorization The OAuth 2 bearer access token you received from [ / auth / v3 / oauth / token ] ( / reference / authentication / Authentication / index . html # retrieveToken ) . For example : \ & quot ; Authorization : bearer a4b5da75 - a584-4053-9227-0f0ab23ff06e \ & quot ; ( required ) * @ param global Specifies whether to invalidate all tokens for the current user ( & # x60 ; true & # x60 ; ) or only the current token ( & # x60 ; false & # x60 ; ) . ( optional ) * @ param redirectUri Specifies the URI where the browser is redirected after sign - out is successful . ( optional ) * @ return ApiResponse & lt ; ModelApiResponse & gt ; * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */ public ApiResponse < ModelApiResponse > signOut1WithHttpInfo ( String authorization , Boolean global , String redirectUri ) throws ApiException { } }
com . squareup . okhttp . Call call = signOut1ValidateBeforeCall ( authorization , global , redirectUri , null , null ) ; Type localVarReturnType = new TypeToken < ModelApiResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class ClassFinder { /** * Get the ClassFinder instance for this invocation . */ public static ClassFinder instance ( Context context ) { } }
ClassFinder instance = context . get ( classFinderKey ) ; if ( instance == null ) instance = new ClassFinder ( context ) ; return instance ;
public class MailTransport { /** * Actually send the given array of MimeMessages via JavaMail . * @ param aAllMessages * Email data objects to send . May be < code > null < / code > . * @ return A non - < code > null < / code > map of the failed messages */ @ Nonnull public ICommonsOrderedMap < IMutableEmailData , MailTransportError > send ( @ Nullable final Collection < IMutableEmailData > aAllMessages ) { } }
final ICommonsOrderedMap < IMutableEmailData , MailTransportError > aFailedMessages = new CommonsLinkedHashMap < > ( ) ; if ( aAllMessages != null ) { final ICommonsList < IMutableEmailData > aRemainingMessages = new CommonsArrayList < > ( aAllMessages ) ; MailSendException aExceptionToBeRemembered = null ; try ( final Transport aTransport = m_aSession . getTransport ( m_bSMTPS ? SMTPS_PROTOCOL : SMTP_PROTOCOL ) ) { // Add global listeners ( if present ) for ( final ConnectionListener aConnectionListener : EmailGlobalSettings . getAllConnectionListeners ( ) ) aTransport . addConnectionListener ( aConnectionListener ) ; // Check if a detailed listener is present final ICommonsList < IEmailDataTransportListener > aEmailDataTransportListeners = EmailGlobalSettings . getAllEmailDataTransportListeners ( ) ; // Connect aTransport . connect ( m_aSMTPSettings . getHostName ( ) , m_aSMTPSettings . getPort ( ) , m_aSMTPSettings . getUserName ( ) , m_aSMTPSettings . getPassword ( ) ) ; // For all messages for ( final IMutableEmailData aEmailData : aAllMessages ) { final MimeMessage aMimeMessage = new MimeMessage ( m_aSession ) ; try { // convert from IEmailData to MimeMessage MailConverter . fillMimeMessage ( aMimeMessage , aEmailData , m_aSMTPSettings . getCharsetObj ( ) ) ; // Ensure a sent date is present if ( aMimeMessage . getSentDate ( ) == null ) aMimeMessage . setSentDate ( new Date ( ) ) ; // Get an explicitly specified message ID final String sMessageID = aMimeMessage . getMessageID ( ) ; // This creates a new message ID ( besides other things ) aMimeMessage . saveChanges ( ) ; if ( sMessageID != null ) { // Preserve explicitly specified message id . . . aMimeMessage . setHeader ( HEADER_MESSAGE_ID , sMessageID ) ; } aMimeMessage . setHeader ( "X-Mailer" , X_MAILER ) ; if ( LOGGER . isInfoEnabled ( ) ) LOGGER . info ( "Delivering mail from " + Arrays . toString ( aMimeMessage . getFrom ( ) ) + " to " + Arrays . toString ( aMimeMessage . getAllRecipients ( ) ) + " with subject '" + aMimeMessage . getSubject ( ) + "' and message ID '" + aMimeMessage . getMessageID ( ) + "'" ) ; // Main transmit - always throws an exception aTransport . sendMessage ( aMimeMessage , aMimeMessage . getAllRecipients ( ) ) ; throw new IllegalStateException ( "Never expected to come beyong sendMessage!" ) ; } catch ( final SendFailedException ex ) { if ( EmailGlobalSettings . isDebugSMTP ( ) ) LOGGER . error ( "Error send mail - SendFailedException" , ex ) ; /* * Extract all addresses : the valid addresses to which the message * was sent , the valid address to which the message was not sent and * the invalid addresses */ final ICommonsSet < String > aValidSent = CollectionHelper . newSetMapped ( ex . getValidSentAddresses ( ) , Address :: toString ) ; final ICommonsSet < String > aValidUnsent = CollectionHelper . newSetMapped ( ex . getValidUnsentAddresses ( ) , Address :: toString ) ; final ICommonsSet < String > aInvalid = CollectionHelper . newSetMapped ( ex . getInvalidAddresses ( ) , Address :: toString ) ; final ICommonsList < MailSendDetails > aDetails = new CommonsArrayList < > ( ) ; Exception ex2 ; MessagingException bex = ex ; while ( ( ex2 = bex . getNextException ( ) ) != null && ex2 instanceof MessagingException ) { if ( ex2 instanceof SMTPAddressFailedException ) { final SMTPAddressFailedException ssfe = ( SMTPAddressFailedException ) ex2 ; aDetails . add ( new MailSendDetails ( false , ssfe . getAddress ( ) . toString ( ) , ssfe . getCommand ( ) , ssfe . getMessage ( ) . trim ( ) , ESMTPErrorCode . getFromIDOrDefault ( ssfe . getReturnCode ( ) , ESMTPErrorCode . FALLBACK ) ) ) ; } else if ( ex2 instanceof SMTPAddressSucceededException ) { final SMTPAddressSucceededException ssfe = ( SMTPAddressSucceededException ) ex2 ; aDetails . add ( new MailSendDetails ( true , ssfe . getAddress ( ) . toString ( ) , ssfe . getCommand ( ) , ssfe . getMessage ( ) . trim ( ) , ESMTPErrorCode . getFromIDOrDefault ( ssfe . getReturnCode ( ) , ESMTPErrorCode . FALLBACK ) ) ) ; } bex = ( MessagingException ) ex2 ; } // Map addresses to details final ICommonsOrderedSet < MailSendDetails > aValidSentExt = new CommonsLinkedHashSet < > ( ) ; final ICommonsOrderedSet < MailSendDetails > aValidUnsentExt = new CommonsLinkedHashSet < > ( ) ; final ICommonsOrderedSet < MailSendDetails > aInvalidExt = new CommonsLinkedHashSet < > ( ) ; for ( final MailSendDetails aFailure : aDetails ) { final String sAddress = aFailure . getAddress ( ) ; if ( aValidSent . contains ( sAddress ) ) aValidSentExt . add ( aFailure ) ; else if ( aValidUnsent . contains ( sAddress ) ) aValidUnsentExt . add ( aFailure ) ; else aInvalidExt . add ( aFailure ) ; } final EmailDataTransportEvent aEvent = new EmailDataTransportEvent ( m_aSMTPSettings , aEmailData , aMimeMessage , aValidSentExt , aValidUnsentExt , aInvalidExt ) ; if ( aValidUnsent . isEmpty ( ) && aInvalid . isEmpty ( ) && aValidSent . isNotEmpty ( ) ) { // Message delivered for ( final IEmailDataTransportListener aEmailDataTransportListener : aEmailDataTransportListeners ) aEmailDataTransportListener . messageDelivered ( aEvent ) ; // Remove message from list of remaining s_aStatsCountSuccess . increment ( ) ; } else { // Message not delivered for ( final IEmailDataTransportListener aEmailDataTransportListener : aEmailDataTransportListeners ) aEmailDataTransportListener . messageNotDelivered ( aEvent ) ; // Sending exactly this message failed aFailedMessages . put ( aEmailData , new MailTransportError ( ex , aDetails ) ) ; s_aStatsCountFailed . increment ( ) ; } // Remove message from list of remaining as we put it in the // failed message list manually in case of error aRemainingMessages . remove ( aEmailData ) ; } catch ( final MessagingException ex ) { if ( EmailGlobalSettings . isDebugSMTP ( ) ) LOGGER . error ( "Error send mail - MessagingException" , ex ) ; final ICommonsOrderedSet < MailSendDetails > aInvalid = new CommonsLinkedHashSet < > ( ) ; final Consumer < IEmailAddress > aConsumer = a -> aInvalid . add ( new MailSendDetails ( false , a . getAddress ( ) , "<generic error>" , ex . getMessage ( ) , ESMTPErrorCode . FALLBACK ) ) ; aEmailData . forEachTo ( aConsumer ) ; aEmailData . forEachCc ( aConsumer ) ; aEmailData . forEachBcc ( aConsumer ) ; final EmailDataTransportEvent aEvent = new EmailDataTransportEvent ( m_aSMTPSettings , aEmailData , aMimeMessage , new CommonsArrayList < > ( ) , new CommonsArrayList < > ( ) , aInvalid ) ; // Message not delivered for ( final IEmailDataTransportListener aEmailDataTransportListener : aEmailDataTransportListeners ) aEmailDataTransportListener . messageNotDelivered ( aEvent ) ; // Sending exactly this message failed aFailedMessages . put ( aEmailData , new MailTransportError ( ex ) ) ; // Remove message from list of remaining as we put it in the // failed message list manually aRemainingMessages . remove ( aEmailData ) ; s_aStatsCountFailed . increment ( ) ; } } // for all messages } catch ( final AuthenticationFailedException ex ) { // problem with the credentials aExceptionToBeRemembered = new MailSendException ( "Mail server authentication failed" , ex ) ; } catch ( final MessagingException ex ) { if ( WebExceptionHelper . isServerNotReachableConnection ( ex . getCause ( ) ) ) aExceptionToBeRemembered = new MailSendException ( "Failed to connect to mail server: " + ex . getCause ( ) . getMessage ( ) ) ; else aExceptionToBeRemembered = new MailSendException ( "Mail server connection failed" , ex ) ; } catch ( final Exception ex ) { // E . g . IllegalState from SMTPTransport ( " Not connected " ) aExceptionToBeRemembered = new MailSendException ( "Internal error sending mail" , ex ) ; } finally { // Was any message not sent if ( aRemainingMessages . isNotEmpty ( ) ) { if ( aExceptionToBeRemembered == null ) aExceptionToBeRemembered = new MailSendException ( "Internal error - messages are remaining but no Exception occurred!" ) ; for ( final IMutableEmailData aRemainingMessage : aRemainingMessages ) aFailedMessages . put ( aRemainingMessage , new MailTransportError ( aExceptionToBeRemembered ) ) ; } } } return aFailedMessages ;
public class ChargingStationEventListener { /** * Handles the { @ link ConfigurationItemsReceivedEvent } . * @ param event the event to handle . */ @ EventHandler public void handle ( ConfigurationItemsReceivedEvent event ) { } }
ChargingStation chargingStation = repository . findOne ( event . getChargingStationId ( ) . getId ( ) ) ; if ( chargingStation != null ) { LOG . debug ( "found chargingstation: " + chargingStation . getId ( ) + " setting configurationitems" ) ; if ( event . getRequestedKeys ( ) . isEmpty ( ) ) { // no ' requested keys ' , we ' ll update the entire set chargingStation . setConfItems ( toConfigurationItemMap ( event . getConfigurationItems ( ) ) ) ; } else { // only update / create the ones requested Map < String , String > confItems = chargingStation . getConfItems ( ) ; for ( String key : event . getRequestedKeys ( ) ) { boolean keyFound = false ; for ( ConfigurationItem confItem : event . getConfigurationItems ( ) ) { if ( key . equals ( confItem . getKey ( ) ) ) { LOG . debug ( "Updating configuration key [{}] with value [{}]" , key , confItem . getValue ( ) ) ; confItems . put ( key , confItem . getValue ( ) ) ; keyFound = true ; } } if ( ! keyFound ) { LOG . debug ( "Configuration key [{}] requested, but not found in the response, remove it from repository if if it exists" , key ) ; // key requested , but not found in the config values in the response , we ' ll remove it confItems . remove ( key ) ; } } } repository . createOrUpdate ( chargingStation ) ; }
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcApproval ( ) { } }
if ( ifcApprovalEClass == null ) { ifcApprovalEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 22 ) ; } return ifcApprovalEClass ;
public class Jingle { /** * Return the XML representation of the packet . * @ return the XML string */ @ Override protected IQChildElementXmlStringBuilder getIQChildElementBuilder ( IQChildElementXmlStringBuilder buf ) { } }
if ( getInitiator ( ) != null ) { buf . append ( " initiator=\"" ) . append ( getInitiator ( ) ) . append ( '"' ) ; } if ( getResponder ( ) != null ) { buf . append ( " responder=\"" ) . append ( getResponder ( ) ) . append ( '"' ) ; } if ( getAction ( ) != null ) { buf . append ( " action=\"" ) . append ( getAction ( ) . toString ( ) ) . append ( '"' ) ; } if ( getSid ( ) != null ) { buf . append ( " sid=\"" ) . append ( getSid ( ) ) . append ( '"' ) ; } buf . append ( '>' ) ; synchronized ( contents ) { for ( JingleContent content : contents ) { buf . append ( content . toXML ( ) ) ; } } // and the same for audio jmf info if ( contentInfo != null ) { buf . append ( contentInfo . toXML ( ) ) ; } return buf ;
public class Logger { /** * Issue a formatted log message with a level of FATAL . * @ param format the format string as per { @ link String # format ( String , Object . . . ) } or resource bundle key therefor * @ param param1 the sole parameter */ public void fatalf ( String format , Object param1 ) { } }
if ( isEnabled ( Level . FATAL ) ) { doLogf ( Level . FATAL , FQCN , format , new Object [ ] { param1 } , null ) ; }
public class Consequent { /** * Modifies the proposition set according to the activation degree ( computed * in the Antecedent of the Rule ) and the implication operator ( given in the * RuleBlock ) * @ param activationDegree is the activation degree computed in the Antecedent * of the Rule * @ param implication is the implication operator configured in the RuleBlock */ public void modify ( double activationDegree , TNorm implication ) { } }
if ( ! isLoaded ( ) ) { throw new RuntimeException ( String . format ( "[consequent error] consequent <%s> is not loaded" , text ) ) ; } for ( Proposition proposition : conclusions ) { if ( proposition . getVariable ( ) . isEnabled ( ) ) { if ( ! proposition . getHedges ( ) . isEmpty ( ) ) { final int lastIndex = proposition . getHedges ( ) . size ( ) ; ListIterator < Hedge > rit = proposition . getHedges ( ) . listIterator ( lastIndex ) ; while ( rit . hasPrevious ( ) ) { activationDegree = rit . previous ( ) . hedge ( activationDegree ) ; } } Activated term = new Activated ( proposition . getTerm ( ) , activationDegree , implication ) ; ( ( OutputVariable ) proposition . getVariable ( ) ) . fuzzyOutput ( ) . getTerms ( ) . add ( term ) ; if ( FuzzyLite . isDebugging ( ) ) { FuzzyLite . logger ( ) . log ( Level . FINE , "Aggregating {0}" , term . toString ( ) ) ; } } }
public class StringRequestConverterFunction { /** * Converts the specified { @ link AggregatedHttpMessage } to a { @ link String } . */ @ Override public Object convertRequest ( ServiceRequestContext ctx , AggregatedHttpMessage request , Class < ? > expectedResultType ) throws Exception { } }
if ( expectedResultType == String . class || expectedResultType == CharSequence . class ) { final MediaType contentType = request . contentType ( ) ; if ( contentType != null && contentType . is ( MediaType . ANY_TEXT_TYPE ) ) { return request . content ( contentType . charset ( ) . orElse ( ArmeriaHttpUtil . HTTP_DEFAULT_CONTENT_CHARSET ) ) ; } } return RequestConverterFunction . fallthrough ( ) ;
public class WebSocketScopeManager { /** * Remove connection from scope . * @ param conn * WebSocketConnection */ public void removeConnection ( WebSocketConnection conn ) { } }
if ( conn != null ) { WebSocketScope scope = getScope ( conn ) ; if ( scope != null ) { scope . removeConnection ( conn ) ; if ( ! scope . isValid ( ) ) { // scope is not valid . delete this . removeWebSocketScope ( scope ) ; } } }
public class ComponentGeneratorsUtil { /** * Return weather a given method is visible in JS ( JsInterop ) . It will be the case if it ' s public * and it ' s class / interface has the { @ link JsType } annotation , or if it has the { @ link JsMethod } * annotation . * @ param method The method to check * @ return true if it is visible ( JsInterop ) , false otherwise */ public static boolean isMethodVisibleInJS ( ExecutableElement method ) { } }
return ( hasAnnotation ( method . getEnclosingElement ( ) , JsType . class ) && method . getModifiers ( ) . contains ( Modifier . PUBLIC ) ) || hasAnnotation ( method , JsMethod . class ) ;
public class CompletableFutureLite { /** * This method enables to exceptionally complete the future with the given { @ code throwable } . * It will be nothing changed if the future was already completed or canceled in advance . * @ param throwable the throwable used to exceptionally complete the future . * @ return if this invocation caused this CompletableFuture to be done , than { @ code true } is returned . Otherwise { @ code false } is returned . */ public boolean completeExceptionally ( final Throwable throwable ) { } }
synchronized ( lock ) { if ( isDone ( ) ) { return false ; } this . throwable = throwable ; lock . notifyAll ( ) ; return true ; }
public class LinkedList { /** * Add a < code > LinkedListNode < / code > to the list . If the < code > LinkedList < / code > is empty then the first and * last nodes are set to the added node . * @ param node * The < code > LinkedListNode < / code > to be added */ public void add ( final T node ) { } }
if ( this . firstNode == null ) { this . firstNode = node ; this . lastNode = node ; } else { this . lastNode . setNext ( node ) ; node . setPrevious ( this . lastNode ) ; this . lastNode = node ; } this . size ++ ;
public class Workgroups { /** * Retrieve a workgroup or all workgroups . */ @ Override @ Path ( "/{groupName}" ) @ ApiOperation ( value = "Retrieve a workgroup or all workgroups" , notes = "If groupName is not present, returns all workgroups." , response = Workgroup . class , responseContainer = "List" ) public JSONObject get ( String path , Map < String , String > headers ) throws ServiceException , JSONException { } }
UserServices userServices = ServiceLocator . getUserServices ( ) ; try { String groupName = getSegment ( path , 1 ) ; if ( groupName == null ) // check parameter groupName = getParameters ( headers ) . get ( "name" ) ; if ( groupName != null ) { Workgroup group = userServices . getWorkgroup ( groupName ) ; if ( group == null ) throw new ServiceException ( ServiceException . NOT_FOUND , "Workgroup not found: " + groupName ) ; return group . getJson ( ) ; } else { return userServices . getWorkgroups ( ) . getJson ( ) ; } } catch ( ServiceException ex ) { throw ex ; } catch ( Exception ex ) { throw new ServiceException ( ex . getMessage ( ) , ex ) ; }
public class IdGenerators { /** * Create a Flake - based { @ link IdGenerator } using the given * { @ link MachineIdProvider } . * @ return the { @ link IdGenerator } */ public static IdGenerator newFlakeIdGenerator ( MachineIdProvider machineIdProvider ) { } }
EncodingProvider encodingProvider = new FlakeEncodingProvider ( machineIdProvider . getMachineId ( ) ) ; return new DefaultIdGenerator ( new SystemTimeProvider ( ) , encodingProvider ) ;
public class CmsLinkUpdateUtil { /** * Decodes entities in a string if it isn ' t null . < p > * @ param value the string for which to decode entities * @ return the string with the decoded entities */ protected static String decodeEntities ( String value ) { } }
if ( value != null ) { value = Translate . decode ( value ) ; } return value ;
public class GetSecurityConfigurationsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetSecurityConfigurationsRequest getSecurityConfigurationsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getSecurityConfigurationsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getSecurityConfigurationsRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; protocolMarshaller . marshall ( getSecurityConfigurationsRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class druidGLexer { /** * $ ANTLR start " PARTITION " */ public final void mPARTITION ( ) throws RecognitionException { } }
try { int _type = PARTITION ; int _channel = DEFAULT_TOKEN_CHANNEL ; // druidG . g : 591:17 : ( ( ' PARTITION ' | ' partition ' ) ) // druidG . g : 591:18 : ( ' PARTITION ' | ' partition ' ) { // druidG . g : 591:18 : ( ' PARTITION ' | ' partition ' ) int alt8 = 2 ; int LA8_0 = input . LA ( 1 ) ; if ( ( LA8_0 == 'P' ) ) { alt8 = 1 ; } else if ( ( LA8_0 == 'p' ) ) { alt8 = 2 ; } else { NoViableAltException nvae = new NoViableAltException ( "" , 8 , 0 , input ) ; throw nvae ; } switch ( alt8 ) { case 1 : // druidG . g : 591:19 : ' PARTITION ' { match ( "PARTITION" ) ; } break ; case 2 : // druidG . g : 591:31 : ' partition ' { match ( "partition" ) ; } break ; } } state . type = _type ; state . channel = _channel ; } finally { // do for sure before leaving }
public class DataSetUtils { public static int getBitSize ( long value ) { } }
if ( value > Integer . MAX_VALUE ) { return 64 - Integer . numberOfLeadingZeros ( ( int ) ( value >> 32 ) ) ; } else { return 32 - Integer . numberOfLeadingZeros ( ( int ) value ) ; }
public class Selenium2Script { /** * XMLファイルを読み込んでDOMにパースします 。 * @ param file * XMLファイル * @ return DOM */ private Document parse ( File file ) { } }
try { DocumentBuilderFactory factory = DocumentBuilderFactory . newInstance ( ) ; DocumentBuilder builder = factory . newDocumentBuilder ( ) ; builder . setEntityResolver ( new EntityResolver ( ) { @ Override public InputSource resolveEntity ( String publicId , String systemId ) throws SAXException , IOException { return new InputSource ( new StringReader ( "" ) ) ; } } ) ; return builder . parse ( file ) ; } catch ( Exception e ) { throw new TestException ( e ) ; }
public class CommonOps_ZDRM { /** * Performs the following operation : < br > * < br > * c = c + a * b < br > * c < sub > ij < / sub > = c < sub > ij < / sub > + & sum ; < sub > k = 1 : n < / sub > { a < sub > ik < / sub > * b < sub > kj < / sub > } * @ param a The left matrix in the multiplication operation . Not modified . * @ param b The right matrix in the multiplication operation . Not modified . * @ param c Where the results of the operation are stored . Modified . */ public static void multAdd ( ZMatrixRMaj a , ZMatrixRMaj b , ZMatrixRMaj c ) { } }
if ( b . numCols >= EjmlParameters . MULT_COLUMN_SWITCH ) { MatrixMatrixMult_ZDRM . multAdd_reorder ( a , b , c ) ; } else { MatrixMatrixMult_ZDRM . multAdd_small ( a , b , c ) ; }
public class CreateLoggerDefinitionRequest { /** * Tag ( s ) to add to the new resource * @ param tags * Tag ( s ) to add to the new resource * @ return Returns a reference to this object so that method calls can be chained together . */ public CreateLoggerDefinitionRequest withTags ( java . util . Map < String , String > tags ) { } }
setTags ( tags ) ; return this ;
public class ProductSegmentation { /** * Gets the mobileApplicationSegment value for this ProductSegmentation . * @ return mobileApplicationSegment * The mobile application segmentation . * < p > This attribute is optional . */ public com . google . api . ads . admanager . axis . v201808 . MobileApplicationTargeting getMobileApplicationSegment ( ) { } }
return mobileApplicationSegment ;
public class CmsResourceTypeStatResultList { /** * Removes result row representing given results . < p > * @ param layout with results * @ param result to be removed */ private void removeRow ( VerticalLayout layout , CmsResourceTypeStatResult result ) { } }
Component componentToRemove = null ; Iterator < Component > iterator = layout . iterator ( ) ; while ( iterator . hasNext ( ) ) { Component component = iterator . next ( ) ; if ( component instanceof HorizontalLayout ) { if ( result . equals ( ( ( HorizontalLayout ) component ) . getData ( ) ) ) { componentToRemove = component ; } } } if ( componentToRemove != null ) { layout . removeComponent ( componentToRemove ) ; }
public class KeyVaultClientBaseImpl { /** * Deletes a secret from a specified key vault . * The DELETE operation applies to any secret stored in Azure Key Vault . DELETE cannot be applied to an individual version of a secret . This operation requires the secrets / delete permission . * @ param vaultBaseUrl The vault name , for example https : / / myvault . vault . azure . net . * @ param secretName The name of the secret . * @ 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 < DeletedSecretBundle > deleteSecretAsync ( String vaultBaseUrl , String secretName , final ServiceCallback < DeletedSecretBundle > serviceCallback ) { } }
return ServiceFuture . fromResponse ( deleteSecretWithServiceResponseAsync ( vaultBaseUrl , secretName ) , serviceCallback ) ;
public class HttpRequester { /** * Gets response as string . * @ param uri the uri * @ param header the header * @ return the response as string */ public static String getResponseAsString ( String uri , Header header ) { } }
HttpGet httpGet = new HttpGet ( uri ) ; httpGet . setHeader ( header ) ; request ( httpGet ) ; return request ( httpGet ) ;
public class Parser { /** * Parse a given XML resource file * @ param license the license res id * @ return the list of parsed libraries */ public static ChangeLog parse ( Context ctx , @ XmlRes int license ) { } }
ChangeLog clog = new ChangeLog ( ) ; // Get the XMLParser XmlPullParser parser = ctx . getResources ( ) . getXml ( license ) ; // Begin parsing try { parser . next ( ) ; parser . require ( XmlPullParser . START_DOCUMENT , null , null ) ; parser . nextTag ( ) ; parser . require ( XmlPullParser . START_TAG , null , DOCUMENT_TAG ) ; while ( parser . next ( ) != XmlPullParser . END_TAG ) { if ( parser . getEventType ( ) != XmlPullParser . START_TAG ) { continue ; } String name = parser . getName ( ) ; if ( name . equals ( TAG_VERSION ) ) { clog . addVersion ( readVersion ( parser ) ) ; } else { skip ( parser ) ; } } } catch ( XmlPullParserException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return clog ;
public class GitService { /** * Initializes war configuration directory for a Cadmium war . * @ param uri The remote Git repository ssh URI . * @ param branch The remote branch to checkout . * @ param root The shared root . * @ param warName The name of the war file . * @ param historyManager The history manager to log the initialization event . * @ return A GitService object the points to the freshly cloned Git repository . * @ throws RefNotFoundException * @ throws Exception */ public static GitService initializeConfigDirectory ( String uri , String branch , String root , String warName , HistoryManager historyManager , ConfigManager configManager ) throws Exception { } }
initializeBaseDirectoryStructure ( root , warName ) ; String warDir = FileSystemManager . getChildDirectoryIfExists ( root , warName ) ; Properties configProperties = configManager . getDefaultProperties ( ) ; GitLocation gitLocation = new GitLocation ( uri , branch , configProperties . getProperty ( "config.git.ref.sha" ) ) ; GitService cloned = initializeRepo ( gitLocation , warDir , "git-config-checkout" ) ; try { String renderedContentDir = initializeSnapshotDirectory ( warDir , configProperties , "com.meltmedia.cadmium.config.lastUpdated" , "git-config-checkout" , "config" ) ; boolean hasExisting = configProperties . containsKey ( "com.meltmedia.cadmium.config.lastUpdated" ) && renderedContentDir != null && renderedContentDir . equals ( configProperties . getProperty ( "com.meltmedia.cadmium.config.lastUpdated" ) ) ; if ( renderedContentDir != null ) { configProperties . setProperty ( "com.meltmedia.cadmium.config.lastUpdated" , renderedContentDir ) ; } configProperties . setProperty ( "config.branch" , cloned . getBranchName ( ) ) ; configProperties . setProperty ( "config.git.ref.sha" , cloned . getCurrentRevision ( ) ) ; configProperties . setProperty ( "config.repo" , cloned . getRemoteRepository ( ) ) ; configManager . persistDefaultProperties ( ) ; ExecutorService pool = null ; if ( historyManager == null ) { pool = Executors . newSingleThreadExecutor ( ) ; historyManager = new HistoryManager ( warDir , pool ) ; } try { if ( historyManager != null && ! hasExisting ) { historyManager . logEvent ( EntryType . CONFIG , // NOTE : We should integrate the git pointer into this class . new GitLocation ( cloned . getRemoteRepository ( ) , cloned . getBranchName ( ) , cloned . getCurrentRevision ( ) ) , "AUTO" , renderedContentDir , "" , "Initial config pull." , true , true ) ; } } finally { if ( pool != null ) { pool . shutdownNow ( ) ; } } return cloned ; } catch ( Throwable e ) { cloned . close ( ) ; throw new Exception ( e ) ; }
public class Attributes2Impl { /** * Returns the current value of an attribute ' s " specified " flag . * @ param qName The XML qualified ( prefixed ) name . * @ return current flag value * @ exception java . lang . IllegalArgumentException When the * supplied name does not identify an attribute . */ public boolean isSpecified ( String qName ) { } }
int index = getIndex ( qName ) ; if ( index < 0 ) throw new IllegalArgumentException ( "No such attribute: " + qName ) ; return specified [ index ] ;
public class Tokenizer { /** * string = ' " ' { char } ' " ' | " ' " { char } " ' " . * char = unescaped | " \ " ( ' " ' | " \ " | " / " | " b " | " f " | " n " | " r " | " t " | " u " hex hex hex hex ) . * unescaped = any printable Unicode character except ' " ' , " ' " or " \ " . */ private Token consumeString ( char quote ) { } }
StringBuilder sb = new StringBuilder ( ) ; int l = line ; int c = column ; Token T ; nextChar ( ) ; while ( moreChars ( ) && ch != quote ) { if ( ch == '\\' ) { nextChar ( ) ; switch ( ch ) { case '"' : case '\\' : case '/' : sb . append ( ch ) ; nextChar ( ) ; break ; case 'b' : sb . append ( '\b' ) ; nextChar ( ) ; break ; case 'f' : sb . append ( '\f' ) ; nextChar ( ) ; break ; case 'n' : sb . append ( '\n' ) ; nextChar ( ) ; break ; case 'r' : sb . append ( '\r' ) ; nextChar ( ) ; break ; case 't' : sb . append ( '\t' ) ; nextChar ( ) ; break ; case 'u' : nextChar ( ) ; int u = 0 ; for ( int i = 0 ; i < 4 ; i ++ ) { if ( isHexDigit ( ch ) ) { u = u * 16 + ch - '0' ; if ( ch >= 'A' ) { // handle hex numbers : ' A ' = 65 , ' 0 ' = 48 . ' A ' - ' 0 ' = 17 , 17 - 7 = 10 u = u - 7 ; } } else { T = new Token ( TokenType . ERROR , sb . toString ( ) , line , column ) ; nextChar ( ) ; return T ; } nextChar ( ) ; } sb . append ( ( char ) u ) ; break ; default : T = new Token ( TokenType . ERROR , sb . toString ( ) , line , column ) ; nextChar ( ) ; return T ; } } else { sb . append ( ch ) ; nextChar ( ) ; } } if ( ch == quote ) { T = new Token ( TokenType . STRING , sb . toString ( ) , l , c ) ; } else { T = new Token ( TokenType . ERROR , sb . toString ( ) , line , column ) ; } nextChar ( ) ; return T ;
public class SocketAddressResolver { /** * Resolves a { @ link io . lettuce . core . RedisURI } to a { @ link java . net . SocketAddress } . * @ param redisURI must not be { @ literal null } . * @ param dnsResolver must not be { @ literal null } . * @ return the resolved { @ link SocketAddress } . */ public static SocketAddress resolve ( RedisURI redisURI , DnsResolver dnsResolver ) { } }
if ( redisURI . getSocket ( ) != null ) { return redisURI . getResolvedAddress ( ) ; } try { InetAddress [ ] inetAddress = dnsResolver . resolve ( redisURI . getHost ( ) ) ; if ( inetAddress . length == 0 ) { return InetSocketAddress . createUnresolved ( redisURI . getHost ( ) , redisURI . getPort ( ) ) ; } return new InetSocketAddress ( inetAddress [ 0 ] , redisURI . getPort ( ) ) ; } catch ( UnknownHostException e ) { return redisURI . getResolvedAddress ( ) ; }
public class BaseSolver { /** * Applies one algorithm on one problem until any condition is met or exception is raised . * This method just removes code duplicities since most solvers has identical this part of solving . It is not * obligatory to use this method however , change it if necessary ( for example algorithm switching on simple * problem ) . * @ param objectiveProblem problem to be solved * @ param algorithm algorithm to be used during solving * @ return result entry for this optimization */ protected ResultEntry optimize ( ObjectiveProblem objectiveProblem , Algorithm algorithm ) { } }
PreciseTimestamp startPreciseTimestamp = null ; Exception algorithmException = null ; Configuration bestConfiguration = null ; int optimizeCounter = 0 ; try { startPreciseTimestamp = new PreciseTimestamp ( ) ; algorithm . init ( objectiveProblem ) ; this . sendMessage ( new MessageSolverStart ( algorithm , objectiveProblem ) ) ; logger . info ( "Started optimize, {} on {}." , algorithm , objectiveProblem ) ; do { algorithm . optimize ( ) ; this . sendMessage ( new MessageOptimize ( ) ) ; optimizeCounter ++ ; if ( algorithm . getBestConfiguration ( ) != null && ( bestConfiguration == null || ! bestConfiguration . equals ( algorithm . getBestConfiguration ( ) ) ) ) { logger . debug ( "Better solution {}, {}, {}" , algorithm . getBestFitness ( ) , optimizeCounter , algorithm . getBestConfiguration ( ) ) ; bestConfiguration = algorithm . getBestConfiguration ( ) ; this . sendMessage ( new MessageBetterConfigurationFound ( bestConfiguration , algorithm . getBestFitness ( ) ) ) ; if ( objectiveProblem . isSolution ( bestConfiguration ) ) this . sendMessage ( new MessageSolutionFound ( bestConfiguration , algorithm . getBestFitness ( ) ) ) ; } if ( this . isConditionMet ( ) ) break ; } while ( true ) ; } catch ( Exception e ) { logger . warn ( "Got exception {}." , e . getClass ( ) . getSimpleName ( ) ) ; algorithmException = e ; } this . sendMessage ( new MessageSolverStop ( algorithm , objectiveProblem ) ) ; logger . info ( "Stopped optimize." ) ; algorithm . cleanUp ( ) ; return new ResultEntry ( algorithm , objectiveProblem , bestConfiguration , algorithm . getBestFitness ( ) , optimizeCounter , algorithmException , startPreciseTimestamp ) ;
public class LdapIdentityStoreDefinitionWrapper { /** * Evaluate and return the callerSearchBase . * @ param immediateOnly If true , only return a non - null value if the setting is either an * immediate EL expression or not set by an EL expression . If false , return the * value regardless of where it is evaluated . * @ return The callerSearchBase or null if immediateOnly = = true AND the value is not evaluated * from a deferred EL expression . */ @ FFDCIgnore ( IllegalArgumentException . class ) private String evaluateCallerSearchBase ( boolean immediateOnly ) { } }
try { return elHelper . processString ( "callerSearchBase" , this . idStoreDefinition . callerSearchBase ( ) , immediateOnly ) ; } catch ( IllegalArgumentException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isWarningEnabled ( ) ) { Tr . warning ( tc , "JAVAEESEC_WARNING_IDSTORE_CONFIG" , new Object [ ] { "callerSearchBase" , "" } ) ; } return "" ; /* Default value from spec . */ }
public class URLHelper { /** * URL - encode the passed value automatically handling charset issues . This is * a ripped , optimized version of URLEncoder . encode but without the * UnsupportedEncodingException . * @ param sValue * The value to be encoded . May not be < code > null < / code > . * @ param aCharset * The charset to use . May not be < code > null < / code > . * @ return The encoded value . */ @ Nonnull public static String urlEncode ( @ Nonnull final String sValue , @ Nonnull final Charset aCharset ) { } }
ValueEnforcer . notNull ( sValue , "Value" ) ; ValueEnforcer . notNull ( aCharset , "Charset" ) ; NonBlockingCharArrayWriter aCAW = null ; try { final int nLen = sValue . length ( ) ; boolean bChanged = false ; final StringBuilder aSB = new StringBuilder ( nLen * 2 ) ; final char [ ] aSrcChars = sValue . toCharArray ( ) ; int nIndex = 0 ; while ( nIndex < nLen ) { char c = aSrcChars [ nIndex ] ; if ( NO_URL_ENCODE . get ( c ) ) { if ( c == ' ' ) { c = '+' ; bChanged = true ; } aSB . append ( c ) ; nIndex ++ ; } else { // convert to external encoding before hex conversion if ( aCAW == null ) aCAW = new NonBlockingCharArrayWriter ( ) ; else aCAW . reset ( ) ; while ( true ) { aCAW . write ( c ) ; /* * If this character represents the start of a Unicode surrogate * pair , then pass in two characters . It ' s not clear what should be * done if a bytes reserved in the surrogate pairs range occurs * outside of a legal surrogate pair . For now , just treat it as if * it were any other character . */ if ( Character . isHighSurrogate ( c ) && nIndex + 1 < nLen ) { final char d = aSrcChars [ nIndex + 1 ] ; if ( Character . isLowSurrogate ( d ) ) { aCAW . write ( d ) ; nIndex ++ ; } } nIndex ++ ; if ( nIndex >= nLen ) break ; // Try next char c = aSrcChars [ nIndex ] ; if ( NO_URL_ENCODE . get ( c ) ) break ; } final byte [ ] aEncodedBytes = aCAW . toByteArray ( aCharset ) ; for ( final byte nEncByte : aEncodedBytes ) { aSB . append ( '%' ) . append ( URL_ENCODE_CHARS [ ( nEncByte >> 4 ) & 0xF ] ) . append ( URL_ENCODE_CHARS [ nEncByte & 0xF ] ) ; } bChanged = true ; } } return bChanged ? aSB . toString ( ) : sValue ; } finally { StreamHelper . close ( aCAW ) ; }
public class ThrottledApiHandler { /** * Get a listing of all league entries in the team ' s leagues * @ param teamId The id of the team * @ return A list of league entries * @ see < a href = https : / / developer . riotgames . com / api / methods # ! / 593/1861 > Official API documentation < / a > */ public Future < List < LeagueItem > > getLeagueEntries ( String teamId ) { } }
return new ApiFuture < > ( ( ) -> handler . getLeagueEntries ( teamId ) ) ;
public class CommerceRegionLocalServiceWrapper { /** * Returns the commerce region matching the UUID and group . * @ param uuid the commerce region ' s UUID * @ param groupId the primary key of the group * @ return the matching commerce region , or < code > null < / code > if a matching commerce region could not be found */ @ Override public com . liferay . commerce . model . CommerceRegion fetchCommerceRegionByUuidAndGroupId ( String uuid , long groupId ) { } }
return _commerceRegionLocalService . fetchCommerceRegionByUuidAndGroupId ( uuid , groupId ) ;
public class DiSHPreferenceVectorIndex { /** * Determines the preference vector according to the specified neighbor ids . * @ param relation the database storing the objects * @ param neighborIDs the list of ids of the neighbors in each dimension * @ param msg a string buffer for debug messages * @ return the preference vector */ private long [ ] determinePreferenceVector ( Relation < V > relation , ModifiableDBIDs [ ] neighborIDs , StringBuilder msg ) { } }
if ( strategy . equals ( Strategy . APRIORI ) ) { return determinePreferenceVectorByApriori ( relation , neighborIDs , msg ) ; } if ( strategy . equals ( Strategy . MAX_INTERSECTION ) ) { return determinePreferenceVectorByMaxIntersection ( neighborIDs , msg ) ; } throw new IllegalStateException ( "Should never happen!" ) ;
public class SnowizardClient { /** * Get a new ID from Snowizard * @ return generated ID * @ throws SnowizardClientException * when unable to get an ID from any host */ public long getId ( ) throws SnowizardClientException { } }
for ( final String host : hosts ) { try { final SnowizardResponse snowizard = executeRequest ( host ) ; if ( snowizard != null ) { return snowizard . getId ( 0 ) ; } } catch ( final Exception ex ) { LOGGER . warn ( "Unable to get ID from host ({})" , host ) ; } } throw new SnowizardClientException ( "Unable to generate ID from Snowizard" ) ;
public class CharAccessor { /** * ( non - Javadoc ) * @ see com . impetus . kundera . property . PropertyAccessor # fromBytes ( byte [ ] ) */ @ Override public Character fromBytes ( Class targetClass , byte [ ] data ) { } }
if ( data == null || data . length != 2 ) { if ( log . isWarnEnabled ( ) ) { log . warn ( "Data length is not matching" ) ; } return 0x0 ; } return ( char ) ( ( 0xff & data [ 0 ] ) << 8 | ( 0xff & data [ 1 ] ) << 0 ) ;
public class AmountFormatContextBuilder { /** * Sets the { @ link javax . money . MonetaryContext } to be used , when amount ' s are parsed . * @ param monetaryAmountBuilder the monetary amount factory , not { @ code null } . * @ return this builder for chaining . */ public AmountFormatContextBuilder setMonetaryAmountFactory ( @ SuppressWarnings ( "rawtypes" ) MonetaryAmountFactory monetaryAmountBuilder ) { } }
Objects . requireNonNull ( monetaryAmountBuilder ) ; return set ( MonetaryAmountFactory . class , monetaryAmountBuilder ) ;
public class SVD { /** * Computes the SVD using Octave . * @ param matrix a file containing a matrix * @ param dimensions the number of singular values to calculate * @ return an array of { @ code Matrix } objects for the U , S , and V matrices * in that order * @ throws UnsupportedOperationException if the Octave SVD algorithm is * unavailable or if any error occurs during the process */ static Matrix [ ] octaveSVDS ( File matrix , int dimensions ) { } }
try { // create the octave file for executing File octaveFile = File . createTempFile ( "octave-svds" , ".m" ) ; File uOutput = File . createTempFile ( "octave-svds-U" , ".dat" ) ; File sOutput = File . createTempFile ( "octave-svds-S" , ".dat" ) ; File vOutput = File . createTempFile ( "octave-svds-V" , ".dat" ) ; octaveFile . deleteOnExit ( ) ; uOutput . deleteOnExit ( ) ; sOutput . deleteOnExit ( ) ; vOutput . deleteOnExit ( ) ; // Print the customized Octave program to a file . PrintWriter pw = new PrintWriter ( octaveFile ) ; pw . println ( "Z = load('" + matrix . getAbsolutePath ( ) + "','-ascii');\n" + "A = spconvert(Z);\n" + "% Remove the raw data file to save space\n" + "clear Z;\n" + "[U, S, V] = svds(A, " + dimensions + " );\n" + "save(\"-ascii\", \"" + uOutput . getAbsolutePath ( ) + "\", \"U\");\n" + "save(\"-ascii\", \"" + sOutput . getAbsolutePath ( ) + "\", \"S\");\n" + "save(\"-ascii\", \"" + vOutput . getAbsolutePath ( ) + "\", \"V\");\n" + "fprintf('Octave Finished\\n');\n" ) ; pw . close ( ) ; // build a command line where octave executes the previously // constructed file String commandLine = "octave " + octaveFile . getAbsolutePath ( ) ; SVD_LOGGER . fine ( commandLine ) ; Process octave = Runtime . getRuntime ( ) . exec ( commandLine ) ; BufferedReader br = new BufferedReader ( new InputStreamReader ( octave . getInputStream ( ) ) ) ; BufferedReader stderr = new BufferedReader ( new InputStreamReader ( octave . getErrorStream ( ) ) ) ; // capture the output StringBuilder output = new StringBuilder ( "Octave svds output:\n" ) ; for ( String line = null ; ( line = br . readLine ( ) ) != null ; ) { output . append ( line ) . append ( "\n" ) ; } SVD_LOGGER . fine ( output . toString ( ) ) ; int exitStatus = octave . waitFor ( ) ; SVD_LOGGER . fine ( "Octave svds exit status: " + exitStatus ) ; // If Octave was successful in generating the files , return them . if ( exitStatus == 0 ) { // Octave returns the matrices in U , S , V , with none of // transposed . To ensure consistence , transpose the V matrix return new Matrix [ ] { // load U in memory , since that is what most algorithms will be // using ( i . e . it is the word space ) MatrixIO . readMatrix ( uOutput , Format . DENSE_TEXT , Type . DENSE_IN_MEMORY ) , // Sigma only has n values for an n ^ 2 matrix , so make it sparse MatrixIO . readMatrix ( sOutput , Format . DENSE_TEXT , Type . SPARSE_ON_DISK ) , // V could be large , so just keep it on disk . Furthermore , // Octave does not transpose V , so transpose it MatrixIO . readMatrix ( vOutput , Format . DENSE_TEXT , Type . DENSE_ON_DISK , true ) } ; } else { StringBuilder sb = new StringBuilder ( ) ; for ( String line = null ; ( line = stderr . readLine ( ) ) != null ; ) { sb . append ( line ) . append ( "\n" ) ; } // warning or error ? SVD_LOGGER . warning ( "Octave exited with error status. " + "stderr:\n" + sb . toString ( ) ) ; } } catch ( IOException ioe ) { SVD_LOGGER . log ( Level . SEVERE , "Octave svds" , ioe ) ; } catch ( InterruptedException ie ) { SVD_LOGGER . log ( Level . SEVERE , "Octave svds" , ie ) ; } throw new UnsupportedOperationException ( "Octave svds is not correctly installed on this system" ) ;
public class ECPImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . ECP__RS_NAME : setRSName ( RS_NAME_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ;
public class FileConvert { /** * Print ATOM record in the following syntax * < pre > * ATOM 1 N ASP A 15 110.964 24.941 59.191 1.00 83.44 N * COLUMNS DATA TYPE FIELD DEFINITION * 1 - 6 Record name " ATOM " * 7 - 11 Integer serial Atom serial number . * 13 - 16 Atom name Atom name . * 17 Character altLoc Alternate location indicator . * 18 - 20 Residue name resName Residue name . * 22 Character chainID Chain identifier . * 23 - 26 Integer resSeq Residue sequence number . * 27 AChar iCode Code for insertion of residues . * 31 - 38 Real ( 8.3 ) x Orthogonal coordinates for X in * Angstroms . * 39 - 46 Real ( 8.3 ) y Orthogonal coordinates for Y in * Angstroms . * 47 - 54 Real ( 8.3 ) z Orthogonal coordinates for Z in * Angstroms . * 55 - 60 Real ( 6.2 ) occupancy Occupancy . * 61 - 66 Real ( 6.2 ) tempFactor Temperature factor . * 73 - 76 LString ( 4 ) segID Segment identifier , left - justified . * 77 - 78 LString ( 2 ) element Element symbol , right - justified . * 79 - 80 LString ( 2 ) charge Charge on the atom . * < / pre > * @ param a * @ param str * @ param chainID the chain ID that the Atom will have in the output string */ public static void toPDB ( Atom a , StringBuffer str , String chainID ) { } }
Group g = a . getGroup ( ) ; GroupType type = g . getType ( ) ; String record = "" ; if ( type . equals ( GroupType . HETATM ) ) { record = "HETATM" ; } else { record = "ATOM " ; } // format output . . . String resName = g . getPDBName ( ) ; String pdbcode = g . getResidueNumber ( ) . toString ( ) ; int seri = a . getPDBserial ( ) ; String serial = String . format ( "%5d" , seri ) ; String fullName = formatAtomName ( a ) ; Character altLoc = a . getAltLoc ( ) ; if ( altLoc == null ) altLoc = ' ' ; String resseq = "" ; if ( hasInsertionCode ( pdbcode ) ) resseq = String . format ( "%5s" , pdbcode ) ; else resseq = String . format ( "%4s" , pdbcode ) + " " ; String x = String . format ( "%8s" , d3 . format ( a . getX ( ) ) ) ; String y = String . format ( "%8s" , d3 . format ( a . getY ( ) ) ) ; String z = String . format ( "%8s" , d3 . format ( a . getZ ( ) ) ) ; String occupancy = String . format ( "%6s" , d2 . format ( a . getOccupancy ( ) ) ) ; String tempfactor = String . format ( "%6s" , d2 . format ( a . getTempFactor ( ) ) ) ; String leftResName = String . format ( "%3s" , resName ) ; StringBuffer s = new StringBuffer ( ) ; s . append ( record ) ; s . append ( serial ) ; s . append ( " " ) ; s . append ( fullName ) ; s . append ( altLoc ) ; s . append ( leftResName ) ; s . append ( " " ) ; s . append ( chainID ) ; s . append ( resseq ) ; s . append ( " " ) ; s . append ( x ) ; s . append ( y ) ; s . append ( z ) ; s . append ( occupancy ) ; s . append ( tempfactor ) ; Element e = a . getElement ( ) ; String eString = e . toString ( ) . toUpperCase ( ) ; if ( e . equals ( Element . R ) ) { eString = "X" ; } str . append ( String . format ( "%-76s%2s" , s . toString ( ) , eString ) ) ; str . append ( newline ) ;
public class AssignmentServiceProvider { /** * for test purpose */ static AssignmentService override ( AssignmentStrategy strategy ) { } }
Holder . INSTANCE . setAssignmentService ( new AssignmentServiceImpl ( strategy ) ) ; return get ( ) ;
public class DefaultOutputConnection { /** * Handles a batch start . */ private void doStartBatch ( String batchID ) { } }
if ( currentBatch != null && currentBatch . id ( ) . equals ( batchID ) ) { currentBatch . handleStart ( ) ; }
public class INodeDirectory { /** * Add new inode to the parent if specified . * Optimized version of addNode ( ) if parent is not null . * @ return parent INode if new inode is inserted * or null if it already exists . * @ throws FileNotFoundException if parent does not exist or * is not a directory . */ INodeDirectory addToParent ( byte [ ] localname , INode newNode , INodeDirectory parent , boolean inheritPermission , boolean propagateModTime , int childIndex ) throws FileNotFoundException { } }
// insert into the parent children list newNode . name = localname ; if ( parent . addChild ( newNode , inheritPermission , propagateModTime , childIndex ) == null ) return null ; return parent ;
public class MediaTypeSet { /** * Finds the { @ link MediaType } in this { @ link List } that matches the specified media range . * @ return the { @ link MediaType } that matches the specified media range . * { @ link Optional # empty ( ) } if there are no matches */ public Optional < MediaType > match ( MediaType range ) { } }
requireNonNull ( range , "range" ) ; for ( MediaType candidate : mediaTypes ) { if ( candidate . belongsTo ( range ) ) { // With only one specified range , there is no way for candidates to have priority over each // other , we just return the first match . return Optional . of ( candidate ) ; } } return Optional . empty ( ) ;
public class CmsADEConfigData { /** * Gets the configuration for the available properties . < p > * @ return the configuration for the available properties */ public List < CmsPropertyConfig > getPropertyConfiguration ( ) { } }
CmsADEConfigData parentData = parent ( ) ; List < CmsPropertyConfig > parentProperties ; if ( ( parentData != null ) && ! m_data . isDiscardInheritedProperties ( ) ) { parentProperties = parentData . getPropertyConfiguration ( ) ; } else { parentProperties = Collections . emptyList ( ) ; } List < CmsPropertyConfig > result = combineConfigurationElements ( parentProperties , m_data . getOwnPropertyConfigurations ( ) , false ) ; return result ;
public class IfcMaterialProfileSetImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public EList < IfcMaterialProfile > getMaterialProfiles ( ) { } }
return ( EList < IfcMaterialProfile > ) eGet ( Ifc4Package . Literals . IFC_MATERIAL_PROFILE_SET__MATERIAL_PROFILES , true ) ;
public class MapExtensions { /** * Remove pairs with the given keys from the map . * @ param < K > type of the map keys . * @ param < V > type of the map values . * @ param map the map to update . * @ param keysToRemove the keys of the pairs to remove . * @ since 2.15 */ public static < K , V > void operator_remove ( Map < K , V > map , Iterable < ? super K > keysToRemove ) { } }
for ( final Object key : keysToRemove ) { map . remove ( key ) ; }
public class ProducerSequenceFactory { /** * bitmap cache get - > * background thread hand - off - > multiplex - > bitmap cache - > decode - > * branch on separate images * - > exif resize and rotate - > exif thumbnail creation * - > local image resize and rotate - > add meta data producer - > multiplex - > encoded cache - > * ( webp transcode ) - > local asset fetch . */ private synchronized Producer < CloseableReference < CloseableImage > > getLocalAssetFetchSequence ( ) { } }
if ( mLocalAssetFetchSequence == null ) { LocalAssetFetchProducer localAssetFetchProducer = mProducerFactory . newLocalAssetFetchProducer ( ) ; mLocalAssetFetchSequence = newBitmapCacheGetToLocalTransformSequence ( localAssetFetchProducer ) ; } return mLocalAssetFetchSequence ;
public class AttachmentPart { /** * Gets the value of the MIME header whose name is " Content - Type " . * @ return a < code > String < / code > giving the value of the * " Content - Type " header or < code > null < / code > if there * is none */ public String getContentType ( ) { } }
String [ ] values = getMimeHeader ( "Content-Type" ) ; if ( values != null && values . length > 0 ) return values [ 0 ] ; return null ;
public class CheckRangeHandler { /** * Constructor . * @ param field The basefield owner of this listener ( usually null and set on setOwner ( ) ) . * @ param dStartRange Start of range ( inclusive ) . * @ param dEndRange End of range ( inclusive ) . */ public void init ( BaseField field , double dStartRange , double dEndRange ) { } }
super . init ( field ) ; m_dStartRange = dStartRange ; m_dEndRange = dEndRange ; m_bScreenMove = true ; m_bInitMove = false ; m_bReadMove = false ;
public class KVStore { /** * Put a map of ( key , value ) pair into the store . The value could be any type * that supported by { @ link ValueObject } * @ param kvMap a map of { key , value } pair */ @ Override public KVStore putValues ( Map < String , Object > kvMap ) { } }
for ( String key : kvMap . keySet ( ) ) { put ( key , ValueObject . of ( kvMap . get ( key ) ) ) ; } return this ;
public class PlaybackView { /** * Used to update the play / pause button . * Should be synchronize with the player playing state . * See also : { @ link CheerleaderPlayer # isPlaying ( ) } . * @ param isPlaying true if a track is currently played . */ private void setPlaying ( boolean isPlaying ) { } }
if ( isPlaying ) { mPlayPause . setImageResource ( R . drawable . ic_pause_white ) ; } else { mPlayPause . setImageResource ( R . drawable . ic_play_white ) ; }
public class OptimizeEngineFactory { /** * Create encrypt optimize engine instance . * @ param encryptRule encrypt rule * @ param sqlStatement sql statement * @ param parameters parameters * @ return encrypt optimize engine instance */ public static OptimizeEngine newInstance ( final EncryptRule encryptRule , final SQLStatement sqlStatement , final List < Object > parameters ) { } }
if ( sqlStatement instanceof InsertStatement ) { return new EncryptInsertOptimizeEngine ( encryptRule , ( InsertStatement ) sqlStatement , parameters ) ; } return new EncryptDefaultOptimizeEngine ( ) ;
public class BatchResources { /** * Deletes the batch having the given ID . * @ param req HTTPServlet request . Cannot be null . * @ param batchId The batch ID to retrieve . * @ return An empty body if the delete was successful . * @ throws WebApplicationException If an error occurs . */ @ DELETE @ Produces ( MediaType . APPLICATION_JSON ) @ Path ( "/{batchId}" ) @ Description ( "Deletes the batch having the given ID." ) public Response deleteBatch ( @ Context HttpServletRequest req , @ PathParam ( "batchId" ) String batchId ) { } }
_validateBatchId ( batchId ) ; PrincipalUser currentOwner = validateAndGetOwner ( req , null ) ; BatchMetricQuery batch = batchService . findBatchById ( batchId ) ; if ( batch != null ) { PrincipalUser actualOwner = userService . findUserByUsername ( batch . getOwnerName ( ) ) ; validateResourceAuthorization ( req , actualOwner , currentOwner ) ; batchService . deleteBatch ( batchId ) ; return Response . status ( Response . Status . OK ) . build ( ) ; } throw new WebApplicationException ( Response . Status . NOT_FOUND . getReasonPhrase ( ) , Response . Status . NOT_FOUND ) ;
public class ObjectRange { /** * Iterates over all values and returns true if one value matches . * @ see # containsWithinBounds ( Object ) */ @ Override public boolean contains ( Object value ) { } }
final Iterator < Comparable > iter = new StepIterator ( this , 1 ) ; if ( value == null ) { return false ; } while ( iter . hasNext ( ) ) { if ( DefaultTypeTransformation . compareEqual ( value , iter . next ( ) ) ) return true ; } return false ;
public class RedisRecordCursor { /** * Otherwise they need to be found by scanning Redis */ private boolean fetchKeys ( ) { } }
try ( Jedis jedis = jedisPool . getResource ( ) ) { switch ( split . getKeyDataType ( ) ) { case STRING : { String cursor = SCAN_POINTER_START ; if ( redisCursor != null ) { cursor = redisCursor . getStringCursor ( ) ; } log . debug ( "Scanning new Redis keys from cursor %s . %d values read so far" , cursor , totalValues ) ; redisCursor = jedis . scan ( cursor , scanParms ) ; List < String > keys = redisCursor . getResult ( ) ; keysIterator = keys . iterator ( ) ; } break ; case ZSET : Set < String > keys = jedis . zrange ( split . getKeyName ( ) , split . getStart ( ) , split . getEnd ( ) ) ; keysIterator = keys . iterator ( ) ; break ; default : log . debug ( "Redis type of key %s is unsupported" , split . getKeyDataFormat ( ) ) ; return false ; } } return true ;
public class Gridmix { /** * Write random bytes at the path provided . * @ see org . apache . hadoop . mapred . gridmix . GenerateData */ protected void writeInputData ( long genbytes , Path ioPath ) throws IOException , InterruptedException { } }
final Configuration conf = getConf ( ) ; final GridmixJob genData = new GenerateData ( conf , ioPath , genbytes ) ; submitter . add ( genData ) ; LOG . info ( "Generating " + StringUtils . humanReadableInt ( genbytes ) + " of test data..." ) ; // TODO add listeners , use for job dependencies TimeUnit . SECONDS . sleep ( 10 ) ; try { genData . getJob ( ) . waitForCompletion ( false ) ; } catch ( ClassNotFoundException e ) { throw new IOException ( "Internal error" , e ) ; } if ( ! genData . getJob ( ) . isSuccessful ( ) ) { throw new IOException ( "Data generation failed!" ) ; } LOG . info ( "Done." ) ;
public class AbstractStructrCmisService { /** * Returns the CMIS info that is defined in the given Structr type , or null . * @ param type * @ return */ public CMISInfo getCMISInfo ( final Class < ? extends GraphObject > type ) { } }
try { return type . newInstance ( ) . getCMISInfo ( ) ; } catch ( Throwable t ) { } return null ;
public class CPTaxCategoryPersistenceImpl { /** * Creates a new cp tax category with the primary key . Does not add the cp tax category to the database . * @ param CPTaxCategoryId the primary key for the new cp tax category * @ return the new cp tax category */ @ Override public CPTaxCategory create ( long CPTaxCategoryId ) { } }
CPTaxCategory cpTaxCategory = new CPTaxCategoryImpl ( ) ; cpTaxCategory . setNew ( true ) ; cpTaxCategory . setPrimaryKey ( CPTaxCategoryId ) ; cpTaxCategory . setCompanyId ( companyProvider . getCompanyId ( ) ) ; return cpTaxCategory ;
public class CmsModuleManager { /** * Returns a map of modules found in the given RFS absolute path . < p > * @ param rfsAbsPath the path to look for module distributions * @ return a map of < code > { @ link CmsModule } < / code > objects for keys and filename for values * @ throws CmsConfigurationException if something goes wrong */ public static Map < CmsModule , String > getAllModulesFromPath ( String rfsAbsPath ) throws CmsConfigurationException { } }
Map < CmsModule , String > modules = new HashMap < CmsModule , String > ( ) ; if ( rfsAbsPath == null ) { return modules ; } File folder = new File ( rfsAbsPath ) ; if ( folder . exists ( ) ) { // list all child resources in the given folder File [ ] folderFiles = folder . listFiles ( ) ; if ( folderFiles != null ) { for ( int i = 0 ; i < folderFiles . length ; i ++ ) { File moduleFile = folderFiles [ i ] ; if ( moduleFile . isFile ( ) && ! ( moduleFile . getAbsolutePath ( ) . toLowerCase ( ) . endsWith ( ".zip" ) ) ) { // skip non - ZIP files continue ; } if ( moduleFile . isDirectory ( ) ) { File manifest = new File ( moduleFile , CmsImportExportManager . EXPORT_MANIFEST ) ; if ( ! manifest . exists ( ) || ! manifest . canRead ( ) ) { // skip unused directories continue ; } } modules . put ( CmsModuleImportExportHandler . readModuleFromImport ( moduleFile . getAbsolutePath ( ) ) , moduleFile . getName ( ) ) ; } } } return modules ;
public class FileSystemContext { /** * Closes all the resources associated with the context . Make sure all the resources are released * back to this context before calling this close . After closing the context , all the resources * that acquired from this context might fail . Only call this when you are done with using * the { @ link FileSystem } associated with this { @ link FileSystemContext } . */ public synchronized void close ( ) throws IOException { } }
if ( ! mClosed . get ( ) ) { // Setting closed should be the first thing we do because if any of the close operations // fail we ' ll only have a half - closed object and performing any more operations or closing // again on a half - closed object can possibly result in more errors ( i . e . NPE ) . Setting // closed first is also recommended by the JDK that in implementations of # close ( ) that // developers should first mark their resources as closed prior to any exceptions being // thrown . mClosed . set ( true ) ; mWorkerGroup . shutdownGracefully ( 1L , 10L , TimeUnit . SECONDS ) ; mFileSystemMasterClientPool . close ( ) ; mFileSystemMasterClientPool = null ; mBlockMasterClientPool . close ( ) ; mBlockMasterClientPool = null ; mMasterInquireClient = null ; for ( BlockWorkerClientPool pool : mBlockWorkerClientPool . values ( ) ) { pool . close ( ) ; } mBlockWorkerClientPool . clear ( ) ; if ( mMetricsMasterClient != null ) { ThreadUtils . shutdownAndAwaitTermination ( mExecutorService , mClientContext . getConf ( ) . getMs ( PropertyKey . METRICS_CONTEXT_SHUTDOWN_TIMEOUT ) ) ; mMetricsMasterClient . close ( ) ; mMetricsMasterClient = null ; mClientMasterSync = null ; } mLocalWorkerInitialized = false ; mLocalWorker = null ; } else { LOG . warn ( "Attempted to close FileSystemContext with app ID {} which has already been closed" + " or not initialized." , mAppId ) ; }
public class Track { /** * XML stream object serialization */ private static String url ( final Track track ) { } }
return track . getLinks ( ) . isEmpty ( ) ? null : track . getLinks ( ) . get ( 0 ) . getHref ( ) . toString ( ) ;
public class PluginContext { /** * / * Notifies all PluginListeners of a Plugin being added to this class . */ protected void firePluginAddedEvent ( PluginEvent event ) { } }
PluginListener [ ] listeners = new PluginListener [ mPluginListeners . size ( ) ] ; listeners = mPluginListeners . toArray ( listeners ) ; for ( int i = 0 ; i < listeners . length ; i ++ ) { listeners [ i ] . pluginAdded ( event ) ; }
public class HashUtils { /** * Hashes data with the specified hashing algorithm . Returns a hexadecimal result . * @ since 1.1 * @ param data the data to hash * @ param alg the hashing algorithm to use * @ return the hexadecimal hash of the data * @ throws NoSuchAlgorithmException the algorithm is not supported by existing providers */ public static String hashHex ( byte [ ] data , String alg ) throws NoSuchAlgorithmException { } }
return toHex ( hash ( data , alg ) ) ;
public class Solo { /** * Clicks an ActionBar Home / Up button . */ public void clickOnActionBarHomeButton ( ) { } }
if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "clickOnActionBarHomeButton()" ) ; } instrumentation . runOnMainSync ( new Runnable ( ) { @ Override public void run ( ) { clicker . clickOnActionBarHomeButton ( ) ; } } ) ;
public class AptControlImplementation { /** * Initializes the list of ContextField declared directly by this ControlImpl */ private ArrayList < AptContextField > initContexts ( ) { } }
ArrayList < AptContextField > contexts = new ArrayList < AptContextField > ( ) ; if ( _implDecl == null || _implDecl . getFields ( ) == null ) return contexts ; Collection < FieldDeclaration > declaredFields = _implDecl . getFields ( ) ; for ( FieldDeclaration fieldDecl : declaredFields ) { if ( fieldDecl . getAnnotation ( org . apache . beehive . controls . api . context . Context . class ) != null ) contexts . add ( new AptContextField ( this , fieldDecl , _ap ) ) ; } return contexts ;
public class JsonArray { /** * Adds the specified number to self . * @ param number the number that needs to be added to the array . */ public void add ( Number number ) { } }
elements . add ( number == null ? JsonNull . INSTANCE : new JsonPrimitive ( number ) ) ;
public class GetLifecyclePolicyPreviewResult { /** * The results of the lifecycle policy preview request . * @ param previewResults * The results of the lifecycle policy preview request . */ public void setPreviewResults ( java . util . Collection < LifecyclePolicyPreviewResult > previewResults ) { } }
if ( previewResults == null ) { this . previewResults = null ; return ; } this . previewResults = new java . util . ArrayList < LifecyclePolicyPreviewResult > ( previewResults ) ;
public class BaseWindowedBolt { /** * define a session processing time window * @ param size window size , i . e . , session gap */ public BaseWindowedBolt < T > sessionTimeWindow ( Time size ) { } }
long s = size . toMilliseconds ( ) ; ensurePositiveTime ( s ) ; setSizeAndSlide ( s , DEFAULT_SLIDE ) ; this . windowAssigner = ProcessingTimeSessionWindows . withGap ( s ) ; return this ;
public class PoolablePreparedStatement { /** * Method setSQLXML . * @ param parameterIndex * @ param xmlObject * @ throws SQLException * @ see java . sql . PreparedStatement # setSQLXML ( int , SQLXML ) */ @ Override public void setSQLXML ( int parameterIndex , SQLXML xmlObject ) throws SQLException { } }
internalStmt . setSQLXML ( parameterIndex , xmlObject ) ;
public class XMLDecoder { /** * Reads the next object . * @ return the next object * @ exception ArrayIndexOutOfBoundsException * if no more objects to read */ @ SuppressWarnings ( "nls" ) public Object readObject ( ) { } }
if ( inputStream == null ) { return null ; } if ( saxHandler == null ) { saxHandler = new SAXHandler ( ) ; try { SAXParserFactory . newInstance ( ) . newSAXParser ( ) . parse ( inputStream , saxHandler ) ; } catch ( Exception e ) { this . listener . exceptionThrown ( e ) ; } } if ( readObjIndex >= readObjs . size ( ) ) { throw new ArrayIndexOutOfBoundsException ( Messages . getString ( "beans.70" ) ) ; } Elem elem = readObjs . get ( readObjIndex ) ; if ( ! elem . isClosed ) { // bad element , error occurred while parsing throw new ArrayIndexOutOfBoundsException ( Messages . getString ( "beans.70" ) ) ; } readObjIndex ++ ; return elem . result ;
public class EnforcementJobRestEntity { /** * Enables an enforcement job * < pre > * GET / enforcements / { agreementId } * Request : * GET / enforcements HTTP / 1.1 * Response : * Accpets application / xml or application / json * { @ code * The enforcement job with agreement - uuid e3bc4f6a - 5f58-453b - 9f59 - ac3eeaee45b2has started * < / pre > * Example : < li > curl - X PUT localhost : 8080 / sla - service / enforcements / e3bc4f6a - 5f58-453b - 9f59 - ac3eeaee45b2 / start < / li > * @ param agreementId of the enforcementJob * @ return information that the enforcementJob has been started */ @ PUT @ Path ( "{agreementId}/start" ) public Response startEnforcementJob ( @ PathParam ( "agreementId" ) String agreementId ) { } }
logger . debug ( "StartOf startEnforcementJob - Start /enforcementJobs" ) ; EnforcementJobHelperE enforcementJobHelper = getHelper ( ) ; if ( enforcementJobHelper . startEnforcementJob ( agreementId ) ) return buildResponse ( HttpStatus . ACCEPTED , "The enforcement job with agreement-uuid " + agreementId + " has started" ) ; else { logger . info ( "startEnforcementJob ForbiddenException: There has not been possible to start the enforcementJob with agreementId : " + agreementId + " in the SLA Repository Database" ) ; return buildResponse ( HttpStatus . FORBIDDEN , printError ( HttpStatus . FORBIDDEN , "There has not been possible to start the enforcementJob with agreementId : " + agreementId + " in the SLA Repository Database" ) ) ; }
public class ElementImpl { /** * Return the index this element has in its parent children list . When determine the index only elements of the same kind * are counted ; returns - 1 if this element is the only child of its kind . This helper method is used by { @ link # trace ( ) } . * @ return this element index or - 1 if only of its kind . */ private int index ( ) { } }
ElementImpl parent = ( ElementImpl ) getParent ( ) ; if ( parent == null ) { return - 1 ; } Node n = parent . node . getFirstChild ( ) ; int index = 0 ; int twinsCount = 0 ; boolean indexFound = false ; while ( n != null ) { if ( n == node ) { indexFound = true ; } if ( n . getNodeType ( ) == Node . ELEMENT_NODE && n . getNodeName ( ) . equals ( node . getNodeName ( ) ) ) { ++ twinsCount ; if ( ! indexFound ) { ++ index ; } } n = n . getNextSibling ( ) ; } return twinsCount > 1 ? index : - 1 ;
public class FTPServerFacade { /** * Asynchronous ; return before completion . * Start the outgoing transfer * reading the data from the supplied data source . * Any exception that would occure will not be thrown but * returned through the local control channel . */ public void retrieve ( DataSource source ) { } }
try { localControlChannel . resetReplyCount ( ) ; TransferContext context = createTransferContext ( ) ; if ( session . serverMode == Session . SERVER_PASSIVE ) { runTask ( createPassiveConnectTask ( source , context ) ) ; } else { runTask ( createActiveConnectTask ( source , context ) ) ; } } catch ( Exception e ) { exceptionToControlChannel ( e , "ocurred during retrieve()" ) ; }
public class BaseTable { /** * Requery the table . * < p > NOTE : You do not need to Open to do a seek or addNew . * The record pointer is positioned before the first record at BOF . * @ exception DBException */ public void open ( ) throws DBException { } }
if ( this . isOpen ( ) ) return ; // Ignore if already open m_bIsOpen = false ; this . getRecord ( ) . handleInitialKey ( ) ; // Set up the smaller key this . getRecord ( ) . handleEndKey ( ) ; // Set up the larger key this . doOpen ( ) ; // Now do the physical open in sub class . m_bIsOpen = true ; m_iRecordStatus = DBConstants . RECORD_INVALID | DBConstants . RECORD_AT_BOF ; if ( ( this . getRecord ( ) . getOpenMode ( ) & DBConstants . OPEN_SUPPRESS_MESSAGES ) == 0 ) this . getRecord ( ) . handleRecordChange ( DBConstants . AFTER_REQUERY_TYPE ) ; // Notify listeners that a new table will be built
public class Auth { /** * Logs into the Cloud SDK with a specific user ( does not retrigger auth flow if user is already * configured for the system ) . * @ param user a user email * @ throws AppEngineException when there is an issue with the auth flow */ public void login ( String user ) throws AppEngineException { } }
Preconditions . checkNotNull ( user ) ; if ( ! EMAIL_PATTERN . matcher ( user ) . find ( ) ) { throw new AppEngineException ( "Invalid email address: " + user ) ; } try { runner . run ( ImmutableList . of ( "auth" , "login" , user ) , null ) ; } catch ( ProcessHandlerException | IOException ex ) { throw new AppEngineException ( ex ) ; }
public class Levy { /** * Sets the scale of the Levy distribution * @ param scale the new scale value , must be positive */ public void setScale ( double scale ) { } }
if ( scale <= 0 || Double . isNaN ( scale ) || Double . isInfinite ( scale ) ) throw new ArithmeticException ( "Scale must be a positive value, not " + scale ) ; this . scale = scale ; this . logScale = log ( scale ) ;
public class ClasspathScanner { /** * Returns the fully qualified class names of * all the classes in the classpath . Checks * directories and zip files . The FilenameFilter * will be applied only to files that are in the * zip files and the directories . In other words , * the filter will not be used to sort directories . */ static String [ ] getClasspathFileNames ( ) throws IOException { } }
// for performance we most likely only want to do this once for each interpreter session , // classpath should not change dynamically ChorusLog log = ChorusLogFactory . getLog ( ClasspathScanner . class ) ; log . debug ( "Getting file names " + Thread . currentThread ( ) . getName ( ) ) ; long start = System . currentTimeMillis ( ) ; if ( classpathNames == null ) { classpathNames = findClassNames ( ) ; log . debug ( "Getting file names took " + ( System . currentTimeMillis ( ) - start ) + " millis" ) ; } return classpathNames ;
public class TextToSpeech { /** * Create a custom model . * Creates a new empty custom voice model . You must specify a name for the new custom model . You can optionally * specify the language and a description for the new model . The model is owned by the instance of the service whose * credentials are used to create it . * * * Note : * * This method is currently a beta release . * * * See also : * * [ Creating a custom * model ] ( https : / / cloud . ibm . com / docs / services / text - to - speech / custom - models . html # cuModelsCreate ) . * @ param createVoiceModelOptions the { @ link CreateVoiceModelOptions } containing the options for the call * @ return a { @ link ServiceCall } with a response type of { @ link VoiceModel } */ public ServiceCall < VoiceModel > createVoiceModel ( CreateVoiceModelOptions createVoiceModelOptions ) { } }
Validator . notNull ( createVoiceModelOptions , "createVoiceModelOptions cannot be null" ) ; String [ ] pathSegments = { "v1/customizations" } ; RequestBuilder builder = RequestBuilder . post ( RequestBuilder . constructHttpUrl ( getEndPoint ( ) , pathSegments ) ) ; Map < String , String > sdkHeaders = SdkCommon . getSdkHeaders ( "text_to_speech" , "v1" , "createVoiceModel" ) ; for ( Entry < String , String > header : sdkHeaders . entrySet ( ) ) { builder . header ( header . getKey ( ) , header . getValue ( ) ) ; } builder . header ( "Accept" , "application/json" ) ; final JsonObject contentJson = new JsonObject ( ) ; contentJson . addProperty ( "name" , createVoiceModelOptions . name ( ) ) ; if ( createVoiceModelOptions . language ( ) != null ) { contentJson . addProperty ( "language" , createVoiceModelOptions . language ( ) ) ; } if ( createVoiceModelOptions . description ( ) != null ) { contentJson . addProperty ( "description" , createVoiceModelOptions . description ( ) ) ; } builder . bodyJson ( contentJson ) ; return createServiceCall ( builder . build ( ) , ResponseConverterUtils . getObject ( VoiceModel . class ) ) ;
public class Dimension { /** * Method to add an UoM to this dimension . * @ param _ uom UoM to add */ private void addUoM ( final UoM _uom ) { } }
this . uoMs . add ( _uom ) ; if ( _uom . getId ( ) == this . baseUoMId ) { this . baseUoM = _uom ; }
public class ScoreTemplate { /** * Returns the number value associated to an attribute , as * a double . * @ throws RuntimeException if sa doesn ' t accept boolean value */ public double getAttributeNumber ( ScoreAttribute sa ) { } }
if ( ! ( sa . getDefaultValue ( ) instanceof Number ) ) throw new RuntimeException ( sa . toString ( ) + " is not a number attribute" ) ; return ( ( Number ) getAttributeObject ( sa ) ) . doubleValue ( ) ;
public class TabularDataConverter { /** * A map is translated into a TabularData with a rowtype with two entries : " value " and " key " */ private boolean checkForMapValue ( TabularType pType ) { } }
CompositeType rowType = pType . getRowType ( ) ; // Two entries in the row : " key " and " value " return rowType . containsKey ( TD_KEY_VALUE ) && rowType . containsKey ( TD_KEY_KEY ) && rowType . keySet ( ) . size ( ) == 2 ;