signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class PatternsImpl { /** * Updates a pattern . * @ param appId The application ID . * @ param versionId The version ID . * @ param patternId The pattern ID . * @ param pattern An object representing a pattern . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws ErrorResponseException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the PatternRuleInfo object if successful . */ public PatternRuleInfo updatePattern ( UUID appId , String versionId , UUID patternId , PatternRuleUpdateObject pattern ) { } }
return updatePatternWithServiceResponseAsync ( appId , versionId , patternId , pattern ) . toBlocking ( ) . single ( ) . body ( ) ;
public class SecurityAccessControl { /** * / * ( non - Javadoc ) * @ see nyla . solutions . core . security . data . AccessControl # getPermissions ( ) */ @ Override public synchronized List < Permission > getPermissions ( ) { } }
if ( permissions == null || permissions . isEmpty ( ) ) return null ; return new ArrayList < Permission > ( this . permissions ) ;
public class EmbeddedWrappers { /** * Creates a new { @ link EmbeddedWrapper } with the given rel . * @ param source can be { @ literal null } , will return { @ literal null } if so . * @ param rel must not be { @ literal null } or empty . * @ return */ @ SuppressWarnings ( "unchecked" ) @ Nullable public EmbeddedWrapper wrap ( @ Nullable Object source , LinkRelation rel ) { } }
if ( source == null ) { return null ; } if ( source instanceof EmbeddedWrapper ) { return ( EmbeddedWrapper ) source ; } if ( source instanceof Collection ) { return new EmbeddedCollection ( ( Collection < Object > ) source , rel ) ; } if ( preferCollections ) { return new EmbeddedCollection ( Collections . singleton ( source ) , rel ) ; } return new EmbeddedElement ( source , rel ) ;
public class SettingsCommand { /** * CLI Utility Methods */ static SettingsCommand get ( Map < String , String [ ] > clArgs ) { } }
for ( Command cmd : Command . values ( ) ) { if ( cmd . category == null ) continue ; for ( String name : cmd . names ) { final String [ ] params = clArgs . remove ( name ) ; if ( params == null ) continue ; switch ( cmd . category ) { case BASIC : return SettingsCommandPreDefined . build ( cmd , params ) ; case MIXED : return SettingsCommandPreDefinedMixed . build ( params ) ; case USER : return SettingsCommandUser . build ( params ) ; } } } return null ;
public class XMLUtil { /** * Read an XML file and replies the DOM document . * @ param file is the file to read * @ return the DOM document red from the { @ code file } . * @ throws IOException if the stream cannot be read . * @ throws SAXException if the stream does not contains valid XML data . * @ throws ParserConfigurationException if the parser cannot be configured . */ public static Document readXML ( File file ) throws IOException , SAXException , ParserConfigurationException { } }
assert file != null : AssertMessages . notNullParameter ( ) ; try ( FileInputStream fis = new FileInputStream ( file ) ) { return readXML ( fis ) ; }
public class MenuFlyoutExample { /** * Adds an example menu item with the given text and an example action to the a parent component . * @ param parent the component to add the menu item to . * @ param text the text to display on the menu item . * @ param selectedMenuText the WText to display the selected menu item . */ private void addMenuItem ( final WComponent parent , final String text , final WText selectedMenuText ) { } }
WMenuItem menuItem = new WMenuItem ( text , new ExampleMenuAction ( selectedMenuText ) ) ; menuItem . setActionObject ( text ) ; if ( parent instanceof WSubMenu ) { ( ( WSubMenu ) parent ) . add ( menuItem ) ; } else { ( ( WMenuItemGroup ) parent ) . add ( menuItem ) ; }
public class CookieUtils { /** * Convert the V0 Cookie into a Cookie header string . * @ param cookie * @ return the value of the header . */ private static String convertV0Cookie ( HttpCookie cookie ) { } }
StringBuilder buffer = new StringBuilder ( 40 ) ; // Append name = value buffer . append ( cookie . getName ( ) ) ; String value = cookie . getValue ( ) ; if ( null != value && 0 != value . length ( ) ) { buffer . append ( '=' ) ; buffer . append ( value ) ; } else { // PK48196 - send an empty value string buffer . append ( "=\"\"" ) ; } // check for optional path value = cookie . getPath ( ) ; if ( null != value && 0 != value . length ( ) ) { buffer . append ( "; $Path=" ) ; buffer . append ( value ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Created v0 Cookie: [" + buffer . toString ( ) + "]" ) ; } return buffer . toString ( ) ;
public class SimpleApplication { /** * Write command - line help to the provided stream . If { @ code exit } is * { @ code true } , exit with status code { @ link # EXIT _ FAILURE } . * @ param o Options * @ param exit Exit flag */ private void printHelp ( Options o , boolean exit , OutputStream os ) { } }
final PrintWriter pw = new PrintWriter ( os ) ; final String syntax = getUsage ( ) ; String header = getApplicationName ( ) ; header = header . concat ( "\nOptions:" ) ; HelpFormatter hf = new HelpFormatter ( ) ; hf . printHelp ( pw , 80 , syntax , header , o , 2 , 2 , null , false ) ; pw . flush ( ) ; if ( exit ) { bail ( SUCCESS ) ; }
public class Optionals { /** * Accumulate the results only from those Optionals which have a value present , using the * supplied Monoid ( a combining BiFunction / BinaryOperator and identity element that takes two * input values of the same type and returns the combined result ) { @ see cyclops2 . Monoids } . * < pre > * { @ code * Optional < Integer > just = Optional . of ( 10 ) ; * Optional < Integer > none = Optional . zero ( ) ; * Optional < String > opts = Optional . accumulateJust ( Monoids . stringConcat , Seq . of ( just , none , Optional . of ( 1 ) ) , * Optional . of ( " 101 " ) * < / pre > * @ param optionals Optionals to accumulate * @ param reducer Monoid to combine values from each Optional * @ return Optional with reduced value */ public static < T > Optional < T > accumulatePresent ( final Monoid < T > reducer , final IterableX < Optional < T > > optionals ) { } }
return sequencePresent ( optionals ) . map ( s -> s . reduce ( reducer ) ) ;
public class PathHandler { /** * Adds a path prefix and a handler for that path . If the path does not start * with a / then one will be prepended . * The match is done on a prefix bases , so registering / foo will also match / bar . Exact * path matches are taken into account first . * If / is specified as the path then it will replace the default handler . * @ param path The path * @ param handler The handler * @ see # addPrefixPath ( String , io . undertow . server . HttpHandler ) * @ deprecated Superseded by { @ link # addPrefixPath ( String , io . undertow . server . HttpHandler ) } . */ @ Deprecated public synchronized PathHandler addPath ( final String path , final HttpHandler handler ) { } }
return addPrefixPath ( path , handler ) ;
public class RulesApplier { /** * Determines if a token is matched by a rule element . * @ param token the token to be matched by the element * @ param element the element to be matched against the token * @ return < code > true < / code > if there ' s a match , < code > false < / code > otherwise */ private boolean match ( Token token , Element element , int baseTokenIndex , Sentence sentence ) { } }
boolean match ; boolean negated ; // Sees if the mask must or not match . // Negated is optional , so it can be null , true or false . // If null , consider as false . if ( element . isNegated ( ) == null ) { match = false ; negated = false ; } else { match = element . isNegated ( ) . booleanValue ( ) ; negated = element . isNegated ( ) . booleanValue ( ) ; } for ( Mask mask : element . getMask ( ) ) { // If the token must match the mask . if ( ! negated ) { // If not negated , match starts as false and just one match is needed to make it true . if ( mask . getLexemeMask ( ) != null && mask . getLexemeMask ( ) . equalsIgnoreCase ( token . getLexeme ( ) ) ) { match = true ; } else if ( mask . getPrimitiveMask ( ) != null && matchLemma ( token , mask . getPrimitiveMask ( ) ) ) { match = true ; } else if ( mask . getTagMask ( ) != null && token . getMorphologicalTag ( ) != null ) { match = match | token . getMorphologicalTag ( ) . matchExact ( mask . getTagMask ( ) , false ) ; } else if ( mask . getTagReference ( ) != null && token . getMorphologicalTag ( ) != null ) { match = match | token . getMorphologicalTag ( ) . match ( RuleUtils . createTagMaskFromReference ( mask . getTagReference ( ) , sentence , baseTokenIndex ) , false ) ; } else if ( mask . getOutOfBounds ( ) != null && ( baseTokenIndex == 0 || baseTokenIndex == sentence . getTokens ( ) . size ( ) - 1 ) ) { match = false ; } } else { // The token must NOT match the mask . // If negated , match starts as true and just one match is needed to make it false . if ( mask . getLexemeMask ( ) != null && mask . getLexemeMask ( ) . equalsIgnoreCase ( token . getLexeme ( ) ) ) { match = false ; } else if ( mask . getPrimitiveMask ( ) != null && matchLemma ( token , mask . getPrimitiveMask ( ) ) ) { match = false ; } else if ( mask . getTagMask ( ) != null && token != null && token . getMorphologicalTag ( ) != null ) { match = match & ! token . getMorphologicalTag ( ) . matchExact ( mask . getTagMask ( ) , false ) ; } else if ( mask . getTagReference ( ) != null && token != null && token . getMorphologicalTag ( ) != null ) { match = match & ! token . getMorphologicalTag ( ) . match ( RuleUtils . createTagMaskFromReference ( mask . getTagReference ( ) , sentence , baseTokenIndex ) , false ) ; } else if ( mask . getOutOfBounds ( ) != null && ( baseTokenIndex == 0 || baseTokenIndex == sentence . getTokens ( ) . size ( ) - 1 ) ) { match = false ; } } } return match ;
public class MultiAnalysisResult { /** * Provides the result for a sub - analysis . * @ param subAnalysisLabel The label that was assigned to this sub - analysis in the * MultiAnalysis request . * @ return The result of the given sub - analysis . */ public QueryResult getResultFor ( String subAnalysisLabel ) { } }
if ( ! this . analysesResults . containsKey ( subAnalysisLabel ) ) { throw new IllegalArgumentException ( "No results for a sub-analysis with that label." ) ; } return this . analysesResults . get ( subAnalysisLabel ) ;
public class UniversalIdStrMessage { /** * Creates a new { @ link UniversalIdStrMessage } object . * @ return */ @ SuppressWarnings ( "unchecked" ) public static UniversalIdStrMessage newInstance ( ) { } }
Date now = new Date ( ) ; UniversalIdStrMessage msg = new UniversalIdStrMessage ( ) ; msg . setId ( QueueUtils . IDGEN . generateId128Hex ( ) . toLowerCase ( ) ) . setTimestamp ( now ) ; return msg ;
public class SwingGui { /** * Called when the source text for a script has been updated . */ @ Override public void updateSourceText ( Dim . SourceInfo sourceInfo ) { } }
RunProxy proxy = new RunProxy ( this , RunProxy . UPDATE_SOURCE_TEXT ) ; proxy . sourceInfo = sourceInfo ; SwingUtilities . invokeLater ( proxy ) ;
public class ForwardPagingRestUi { /** * starts the REST server using JDK HttpServer ( com . sun . net . httpserver . HttpServer ) */ private static void startRestService ( CqlSession session ) throws IOException , InterruptedException { } }
final HttpServer server = JdkHttpServerFactory . createHttpServer ( BASE_URI , new VideoApplication ( session ) , false ) ; final ExecutorService executor = Executors . newSingleThreadExecutor ( ) ; server . setExecutor ( executor ) ; Runtime . getRuntime ( ) . addShutdownHook ( new Thread ( ( ) -> { System . out . println ( ) ; System . out . println ( "Stopping REST Service" ) ; server . stop ( 0 ) ; executor . shutdownNow ( ) ; System . out . println ( "REST Service stopped" ) ; } ) ) ; server . start ( ) ; System . out . println ( ) ; System . out . printf ( "REST Service started on http://localhost:%d/users, press CTRL+C to stop%n" , HTTP_PORT ) ; System . out . println ( "To explore this example, start with the following request and walk from there:" ) ; System . out . printf ( "curl -i http://localhost:%d/users/1/videos%n" , HTTP_PORT ) ; System . out . println ( ) ; Thread . currentThread ( ) . join ( ) ;
public class Logger { /** * Issue a formatted log message with a level of INFO . * @ param format the format string as per { @ link String # format ( String , Object . . . ) } or resource bundle key therefor * @ param param1 the sole parameter */ public void infof ( String format , Object param1 ) { } }
if ( isEnabled ( Level . INFO ) ) { doLogf ( Level . INFO , FQCN , format , new Object [ ] { param1 } , null ) ; }
public class Measure { /** * getter for normalizedUnit - gets iso * @ generated * @ return value of the feature */ public String getNormalizedUnit ( ) { } }
if ( Measure_Type . featOkTst && ( ( Measure_Type ) jcasType ) . casFeat_normalizedUnit == null ) jcasType . jcas . throwFeatMissing ( "normalizedUnit" , "ch.epfl.bbp.uima.types.Measure" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Measure_Type ) jcasType ) . casFeatCode_normalizedUnit ) ;
public class RAMDirectoryUtil { /** * Write a number of files from a ram directory to a data output . * @ param out the data output * @ param dir the ram directory * @ param names the names of the files to write * @ throws IOException */ public static void writeRAMFiles ( DataOutput out , RAMDirectory dir , String [ ] names ) throws IOException { } }
out . writeInt ( names . length ) ; for ( int i = 0 ; i < names . length ; i ++ ) { Text . writeString ( out , names [ i ] ) ; long length = dir . fileLength ( names [ i ] ) ; out . writeLong ( length ) ; if ( length > 0 ) { // can we avoid the extra copy ? IndexInput input = null ; try { input = dir . openInput ( names [ i ] , BUFFER_SIZE ) ; int position = 0 ; byte [ ] buffer = new byte [ BUFFER_SIZE ] ; while ( position < length ) { int len = position + BUFFER_SIZE <= length ? BUFFER_SIZE : ( int ) ( length - position ) ; input . readBytes ( buffer , 0 , len ) ; out . write ( buffer , 0 , len ) ; position += len ; } } finally { if ( input != null ) { input . close ( ) ; } } } }
public class CmsProjectSelectDialog { /** * Initializes the form component . < p > * @ return the form component */ private FormLayout initForm ( ) { } }
FormLayout form = new FormLayout ( ) ; form . setWidth ( "100%" ) ; IndexedContainer sites = CmsVaadinUtils . getAvailableSitesContainer ( m_context . getCms ( ) , CAPTION_PROPERTY ) ; m_siteComboBox = prepareComboBox ( sites , org . opencms . workplace . Messages . GUI_LABEL_SITE_0 ) ; m_siteComboBox . select ( m_context . getCms ( ) . getRequestContext ( ) . getSiteRoot ( ) ) ; form . addComponent ( m_siteComboBox ) ; ValueChangeListener changeListener = new ValueChangeListener ( ) { private static final long serialVersionUID = 1L ; public void valueChange ( ValueChangeEvent event ) { submit ( ) ; } } ; m_siteComboBox . addValueChangeListener ( changeListener ) ; IndexedContainer projects = CmsVaadinUtils . getProjectsContainer ( m_context . getCms ( ) , CAPTION_PROPERTY ) ; m_projectComboBox = prepareComboBox ( projects , org . opencms . workplace . Messages . GUI_LABEL_PROJECT_0 ) ; CmsUUID currentProjectId = m_context . getCms ( ) . getRequestContext ( ) . getCurrentProject ( ) . getUuid ( ) ; if ( projects . containsId ( currentProjectId ) ) { m_projectComboBox . select ( currentProjectId ) ; } else { try { CmsUUID ouProject = OpenCms . getOrgUnitManager ( ) . readOrganizationalUnit ( m_context . getCms ( ) , m_context . getCms ( ) . getRequestContext ( ) . getOuFqn ( ) ) . getProjectId ( ) ; if ( projects . containsId ( ouProject ) ) { m_projectComboBox . select ( ouProject ) ; } } catch ( CmsException e ) { LOG . error ( "Error while reading current OU." , e ) ; } } form . addComponent ( m_projectComboBox ) ; m_projectComboBox . addValueChangeListener ( changeListener ) ; return form ;
public class MavenRemoteRepositories { /** * Overload of { @ link # createRemoteRepository ( String , URL , String ) } that thrown an exception if URL is wrong . * @ param id The unique ID of the repository to create ( arbitrary name ) * @ param url The base URL of the Maven repository * @ param layout he repository layout . Should always be " default " * @ return A new < code > MavenRemoteRepository < / code > with the given ID and URL . * @ throws IllegalArgumentException for null or empty id or if the URL is technically wrong or null */ public static MavenRemoteRepository createRemoteRepository ( final String id , final String url , final String layout ) throws IllegalArgumentException { } }
try { return createRemoteRepository ( id , new URL ( url ) , layout ) ; } catch ( MalformedURLException e ) { throw new IllegalArgumentException ( "invalid URL" , e ) ; }
public class FastLogFormatter { /** * - - - FORMATTER - - - */ public String format ( LogRecord record ) { } }
line . setLength ( 0 ) ; line . append ( '[' ) ; line . append ( Instant . ofEpochMilli ( record . getMillis ( ) ) . toString ( ) ) ; final Level l = record . getLevel ( ) ; line . append ( "] " ) ; if ( l == Level . SEVERE ) { line . append ( SEVERE ) ; } else if ( l == Level . WARNING ) { line . append ( WARNING ) ; } else if ( l == Level . INFO ) { line . append ( INFO ) ; } else if ( l == Level . CONFIG ) { line . append ( CONFIG ) ; } else if ( l == Level . FINE ) { line . append ( FINE ) ; } else if ( l == Level . FINER ) { line . append ( FINER ) ; } else { line . append ( FINEST ) ; } String className = record . getSourceClassName ( ) ; int n ; if ( className == null ) { className = "unknown" ; } else { n = className . lastIndexOf ( '$' ) ; if ( n > - 1 ) { className = className . substring ( 0 , n ) ; } } line . append ( className ) ; n = line . length ( ) ; if ( n > position || position - n > 30 ) { position = n ; } n = 1 + position - n ; if ( n > 0 ) { for ( int i = 0 ; i < n ; i ++ ) { line . append ( ' ' ) ; } } line . append ( formatMessage ( record ) ) ; line . append ( BREAK ) ; // Dump error final Throwable cause = record . getThrown ( ) ; if ( cause != null ) { StringBuilder errors = new StringBuilder ( 256 ) ; n = appendMessages ( errors , cause ) ; String trace = errors . toString ( ) . trim ( ) ; if ( ! trace . isEmpty ( ) ) { for ( int i = 0 ; i < n ; i ++ ) { line . append ( '-' ) ; } line . append ( BREAK ) ; line . append ( trace ) ; line . append ( BREAK ) ; for ( int i = 0 ; i < n ; i ++ ) { line . append ( '-' ) ; } line . append ( BREAK ) ; } line . append ( "Trace: " ) ; line . append ( cause . toString ( ) ) ; line . append ( BREAK ) ; StackTraceElement [ ] array = cause . getStackTrace ( ) ; if ( array != null && array . length > 0 ) { for ( n = 0 ; n < array . length ; n ++ ) { line . append ( "-> [" ) ; line . append ( n ) ; line . append ( "] " ) ; line . append ( array [ n ] ) ; line . append ( BREAK ) ; } } } return line . toString ( ) ;
public class TxUtils { /** * Converts a transaction status to a text representation * @ param status The status index * @ return status as String or " STATUS _ INVALID ( value ) " * @ see javax . transaction . Status */ public static String getStatusAsString ( int status ) { } }
if ( status >= Status . STATUS_ACTIVE && status <= Status . STATUS_ROLLING_BACK ) { return TX_STATUS_STRINGS [ status ] ; } else { return "STATUS_INVALID(" + status + ")" ; }
public class HandlerUtils { /** * Sends the given response and status code to the given channel . * @ param channelHandlerContext identifying the open channel * @ param httpRequest originating http request * @ param message which should be sent * @ param statusCode of the message to send * @ param headers additional header values */ public static CompletableFuture < Void > sendResponse ( @ Nonnull ChannelHandlerContext channelHandlerContext , @ Nonnull HttpRequest httpRequest , @ Nonnull String message , @ Nonnull HttpResponseStatus statusCode , @ Nonnull Map < String , String > headers ) { } }
return sendResponse ( channelHandlerContext , HttpHeaders . isKeepAlive ( httpRequest ) , message , statusCode , headers ) ;
public class DefaultApplicationPage { /** * { @ inheritDoc } * Only one pageComponent is shown at a time , so if it ' s the active one , * remove all components from this page . */ protected void doRemovePageComponent ( PageComponent pageComponent ) { } }
if ( pageComponent == getActiveComponent ( ) ) { this . control . removeAll ( ) ; this . control . validate ( ) ; this . control . repaint ( ) ; }
public class BufferedValueModel { /** * Reverts the value held by the value model back to the value held by the * wrapped value model . */ public final void revert ( ) { } }
if ( isBuffering ( ) ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Reverting buffered value '" + getValue ( ) + "' to value '" + wrappedModel . getValue ( ) + "'" ) ; } setValue ( wrappedModel . getValue ( ) ) ; } else { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "No buffered edit to commit; nothing to do..." ) ; } }
public class AbstractVersionInfo { /** * parse and format a date string . * @ param pversionDate string with date in versionDateFormat * @ return the same date formated as dateFormatDisplay */ protected final String parseAndFormatDate ( final String pversionDate ) { } }
Date date ; if ( StringUtils . isEmpty ( pversionDate ) ) { date = new Date ( ) ; } else { try { date = versionDateFormat . parse ( pversionDate ) ; } catch ( final IllegalArgumentException e ) { date = new Date ( ) ; } } return dateFormatDisplay . format ( date ) ;
public class Tile { /** * Removes the given TimeSection from the list of sections . * Sections in the Medusa library usually are less eye - catching * than Areas . * @ param SECTION */ public void removeTimeSection ( final TimeSection SECTION ) { } }
if ( null == SECTION ) return ; getTimeSections ( ) . remove ( SECTION ) ; getTimeSections ( ) . sort ( new TimeSectionComparator ( ) ) ; fireTileEvent ( SECTION_EVENT ) ;
public class AmazonWorkMailClient { /** * Returns an overview of the members of a group . Users and groups can be members of a group . * @ param listGroupMembersRequest * @ return Result of the ListGroupMembers operation returned by the service . * @ throws EntityNotFoundException * The identifier supplied for the user , group , or resource does not exist in your organization . * @ throws EntityStateException * You are performing an operation on a user , group , or resource that isn ' t in the expected state , such as * trying to delete an active user . * @ throws InvalidParameterException * One or more of the input parameters don ' t match the service ' s restrictions . * @ throws OrganizationNotFoundException * An operation received a valid organization identifier that either doesn ' t belong or exist in the system . * @ throws OrganizationStateException * The organization must have a valid state ( Active or Synchronizing ) to perform certain operations on the * organization or its members . * @ sample AmazonWorkMail . ListGroupMembers * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / workmail - 2017-10-01 / ListGroupMembers " target = " _ top " > AWS API * Documentation < / a > */ @ Override public ListGroupMembersResult listGroupMembers ( ListGroupMembersRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeListGroupMembers ( request ) ;
public class Interval { /** * Gets the overlap between this interval and another interval . * Intervals are inclusive of the start instant and exclusive of the end . * An interval overlaps another if it shares some common part of the * datetime continuum . This method returns the amount of the overlap , * only if the intervals actually do overlap . * If the intervals do not overlap , then null is returned . * When two intervals are compared the result is one of three states : * ( a ) they abut , ( b ) there is a gap between them , ( c ) they overlap . * The abuts state takes precedence over the other two , thus a zero duration * interval at the start of a larger interval abuts and does not overlap . * The chronology of the returned interval is the same as that of * this interval ( the chronology of the interval parameter is not used ) . * Note that the use of the chronology was only correctly implemented * in version 1.3. * @ param interval the interval to examine , null means now * @ return the overlap interval , null if no overlap * @ since 1.1 */ public Interval overlap ( ReadableInterval interval ) { } }
interval = DateTimeUtils . getReadableInterval ( interval ) ; if ( overlaps ( interval ) == false ) { return null ; } long start = Math . max ( getStartMillis ( ) , interval . getStartMillis ( ) ) ; long end = Math . min ( getEndMillis ( ) , interval . getEndMillis ( ) ) ; return new Interval ( start , end , getChronology ( ) ) ;
public class DialogPrimitiveFactoryImpl { /** * ( non - Javadoc ) * @ see org . restcomm . protocols . ss7 . tcap . api . tc . dialog . DialogPrimitiveFactory * # createEnd ( org . restcomm . protocols . ss7 . tcap . api . tc . dialog . Dialog ) */ public TCEndRequest createEnd ( Dialog d ) { } }
if ( d == null ) { throw new NullPointerException ( "Dialog is null" ) ; } TCEndRequestImpl tcer = new TCEndRequestImpl ( ) ; tcer . setDialog ( d ) ; tcer . setOriginatingAddress ( d . getLocalAddress ( ) ) ; // FIXME : add dialog portion fill return tcer ;
public class GenericQueueMessage { /** * { @ inheritDoc } */ @ Deprecated @ Override public GenericQueueMessage < ID , DATA > qData ( DATA data ) { } }
setData ( data ) ; return this ;
public class UtlInvBase { /** * < p > Adds total tax by category for farther invoice adjusting . < / p > * @ param pTxdLns Tax Data lines * @ param pCatId tax category ID * @ param pSubt subtotal without taxes * @ param pSubtFc subtotal FC without taxes * @ param pPercent tax rate * @ param pAs AS * @ param pTxRules tax rules */ public final void addInvBsTxExTxc ( final List < SalesInvoiceServiceLine > pTxdLns , final Long pCatId , final Double pSubt , final Double pSubtFc , final Double pPercent , final AccSettings pAs , final TaxDestination pTxRules ) { } }
SalesInvoiceServiceLine txdLn = null ; for ( SalesInvoiceServiceLine tdl : pTxdLns ) { if ( tdl . getItsId ( ) . equals ( pCatId ) ) { txdLn = tdl ; } } if ( txdLn == null ) { txdLn = new SalesInvoiceServiceLine ( ) ; txdLn . setItsId ( pCatId ) ; InvItemTaxCategory tc = new InvItemTaxCategory ( ) ; tc . setItsId ( pCatId ) ; txdLn . setTaxCategory ( tc ) ; pTxdLns . add ( txdLn ) ; } BigDecimal bd100 = new BigDecimal ( "100.00" ) ; BigDecimal txv = BigDecimal . valueOf ( pSubt ) . multiply ( BigDecimal . valueOf ( pPercent ) ) . divide ( bd100 , pAs . getPricePrecision ( ) , pTxRules . getSalTaxRoundMode ( ) ) ; txdLn . setTotalTaxes ( txdLn . getTotalTaxes ( ) . add ( txv ) ) ; BigDecimal txvf = BigDecimal . valueOf ( pSubtFc ) . multiply ( BigDecimal . valueOf ( pPercent ) ) . divide ( bd100 , pAs . getPricePrecision ( ) , pTxRules . getSalTaxRoundMode ( ) ) ; txdLn . setForeignTotalTaxes ( txdLn . getForeignTotalTaxes ( ) . add ( txvf ) ) ;
public class VoiceApi { /** * Start monitoring an agent * Start supervisor monitoring of an agent . Use the parameters to specify how the monitoring should behave . Once you & # 39 ; ve enabled monitoring , you can change the monitoring mode using [ / voice / calls / { id } / switch - to - listen - in ( Mute ) ] ( / reference / workspace / Voice / index . html # switchToListenIn ) , [ / voice / calls / { id } / switch - to - coaching ( Coach ) ] ( / reference / workspace / Voice / index . html # switchToCoaching ) , and [ / voice / calls / { id } / switch - to - barge - in ( Connect ) ] ( / reference / workspace / Voice / index . html # switchToBargeIn ) . * @ param startMonitoringData ( required ) * @ return ApiResponse & lt ; ApiSuccessResponse & gt ; * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */ public ApiResponse < ApiSuccessResponse > startMonitoringWithHttpInfo ( StartMonitoringData startMonitoringData ) throws ApiException { } }
com . squareup . okhttp . Call call = startMonitoringValidateBeforeCall ( startMonitoringData , null , null ) ; Type localVarReturnType = new TypeToken < ApiSuccessResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class RecoveryPointByBackupVaultMarshaller { /** * Marshall the given parameter object . */ public void marshall ( RecoveryPointByBackupVault recoveryPointByBackupVault , ProtocolMarshaller protocolMarshaller ) { } }
if ( recoveryPointByBackupVault == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( recoveryPointByBackupVault . getRecoveryPointArn ( ) , RECOVERYPOINTARN_BINDING ) ; protocolMarshaller . marshall ( recoveryPointByBackupVault . getBackupVaultName ( ) , BACKUPVAULTNAME_BINDING ) ; protocolMarshaller . marshall ( recoveryPointByBackupVault . getBackupVaultArn ( ) , BACKUPVAULTARN_BINDING ) ; protocolMarshaller . marshall ( recoveryPointByBackupVault . getResourceArn ( ) , RESOURCEARN_BINDING ) ; protocolMarshaller . marshall ( recoveryPointByBackupVault . getResourceType ( ) , RESOURCETYPE_BINDING ) ; protocolMarshaller . marshall ( recoveryPointByBackupVault . getCreatedBy ( ) , CREATEDBY_BINDING ) ; protocolMarshaller . marshall ( recoveryPointByBackupVault . getIamRoleArn ( ) , IAMROLEARN_BINDING ) ; protocolMarshaller . marshall ( recoveryPointByBackupVault . getStatus ( ) , STATUS_BINDING ) ; protocolMarshaller . marshall ( recoveryPointByBackupVault . getCreationDate ( ) , CREATIONDATE_BINDING ) ; protocolMarshaller . marshall ( recoveryPointByBackupVault . getCompletionDate ( ) , COMPLETIONDATE_BINDING ) ; protocolMarshaller . marshall ( recoveryPointByBackupVault . getBackupSizeInBytes ( ) , BACKUPSIZEINBYTES_BINDING ) ; protocolMarshaller . marshall ( recoveryPointByBackupVault . getCalculatedLifecycle ( ) , CALCULATEDLIFECYCLE_BINDING ) ; protocolMarshaller . marshall ( recoveryPointByBackupVault . getLifecycle ( ) , LIFECYCLE_BINDING ) ; protocolMarshaller . marshall ( recoveryPointByBackupVault . getEncryptionKeyArn ( ) , ENCRYPTIONKEYARN_BINDING ) ; protocolMarshaller . marshall ( recoveryPointByBackupVault . getIsEncrypted ( ) , ISENCRYPTED_BINDING ) ; protocolMarshaller . marshall ( recoveryPointByBackupVault . getLastRestoreTime ( ) , LASTRESTORETIME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class AbstractCache { /** * This method imports all elements from VocabCache passed as argument * If element already exists , * @ param vocabCache */ public void importVocabulary ( @ NonNull VocabCache < T > vocabCache ) { } }
AtomicBoolean added = new AtomicBoolean ( false ) ; for ( T element : vocabCache . vocabWords ( ) ) { if ( this . addToken ( element ) ) added . set ( true ) ; } // logger . info ( " Current state : { } ; Adding value : { } " , this . documentsCounter . get ( ) , vocabCache . totalNumberOfDocs ( ) ) ; if ( added . get ( ) ) this . documentsCounter . addAndGet ( vocabCache . totalNumberOfDocs ( ) ) ;
public class ImportManager { /** * Checks if the module for importer has been loaded in the memory . If bundle doesn ' t exists , it loades one and * updates the mapping records of the bundles . * @ param moduleProperties * @ return true , if the bundle corresponding to the importer is in memory ( uploaded or was already present ) */ private boolean loadImporterBundle ( Properties moduleProperties ) { } }
String importModuleName = moduleProperties . getProperty ( ImportDataProcessor . IMPORT_MODULE ) ; String attrs [ ] = importModuleName . split ( "\\|" ) ; String bundleJar = attrs [ 1 ] ; String moduleType = attrs [ 0 ] ; try { AbstractImporterFactory importerFactory = m_loadedBundles . get ( bundleJar ) ; if ( importerFactory == null ) { if ( moduleType . equalsIgnoreCase ( "osgi" ) ) { URI bundleURI = URI . create ( bundleJar ) ; importerFactory = m_moduleManager . getService ( bundleURI , AbstractImporterFactory . class ) ; if ( importerFactory == null ) { importLog . error ( "Failed to initialize importer from: " + bundleJar ) ; return false ; } } else { // class based importer . Class < ? > reference = this . getClass ( ) . getClassLoader ( ) . loadClass ( bundleJar ) ; if ( reference == null ) { importLog . error ( "Failed to initialize importer from: " + bundleJar ) ; return false ; } importerFactory = ( AbstractImporterFactory ) reference . newInstance ( ) ; } String importerType = importerFactory . getTypeName ( ) ; if ( importerType == null || importerType . trim ( ) . isEmpty ( ) ) { throw new RuntimeException ( "Importer must implement and return a valid unique name." ) ; } Preconditions . checkState ( ! m_importersByType . containsKey ( importerType ) , "Importer must implement and return a valid unique name: " + importerType ) ; m_importersByType . put ( importerType , importerFactory ) ; m_loadedBundles . put ( bundleJar , importerFactory ) ; } } catch ( Throwable t ) { importLog . error ( "Failed to configure import handler for " + bundleJar , t ) ; Throwables . propagate ( t ) ; } return true ;
public class HeapBuffer { /** * Allocates a new direct buffer . * @ param initialCapacity The initial capacity of the buffer to allocate ( in bytes ) . * @ param maxCapacity The maximum capacity of the buffer . * @ return The direct buffer . * @ throws IllegalArgumentException If { @ code capacity } or { @ code maxCapacity } is greater than the maximum * allowed count for a { @ link java . nio . ByteBuffer } - { @ code Integer . MAX _ VALUE - 5} * @ see HeapBuffer # allocate ( ) * @ see HeapBuffer # allocate ( int ) */ public static HeapBuffer allocate ( int initialCapacity , int maxCapacity ) { } }
checkArgument ( initialCapacity <= maxCapacity , "initial capacity cannot be greater than maximum capacity" ) ; return new HeapBuffer ( HeapBytes . allocate ( ( int ) Math . min ( Memory . Util . toPow2 ( initialCapacity ) , MAX_SIZE ) ) , 0 , initialCapacity , maxCapacity ) ;
public class MenuDrawer { /** * Returns the ViewGroup used as a parent for the content view . * @ return The content view ' s parent . */ public ViewGroup getContentContainer ( ) { } }
if ( mDragMode == MENU_DRAG_CONTENT ) { return mContentContainer ; } else { return ( ViewGroup ) findViewById ( android . R . id . content ) ; }
public class ConsoleCommandHandler { /** * Called by handleCommand . */ String doHandleCommand ( final String command ) { } }
app . handleCommand ( command ) ; final String output = buffer . toString ( ) ; buffer . setLength ( 0 ) ; return output ;
public class FormatTrackingHSSFListenerPlus { /** * Formats the given numeric of date cells contents as a String , in as * close as we can to the way that Excel would do so . Uses the various * format records to manage this . * TODO - move this to a central class in such a way that hssf . usermodel can * make use of it too * @ param cell the cell * @ return the given numeric of date cells contents as a String */ public String formatNumberDateCell ( CellValueRecordInterface cell ) { } }
double value ; if ( cell instanceof NumberRecord ) { value = ( ( NumberRecord ) cell ) . getValue ( ) ; } else if ( cell instanceof FormulaRecord ) { value = ( ( FormulaRecord ) cell ) . getValue ( ) ; } else { throw new IllegalArgumentException ( "Unsupported CellValue Record passed in " + cell ) ; } // Get the built in format , if there is one int formatIndex = getFormatIndex ( cell ) ; String formatString = getFormatString ( cell ) ; if ( formatString == null ) { return _defaultFormat . format ( value ) ; } // Format , using the nice new // HSSFDataFormatter to do the work for us return this . formatRawCellContents ( value , formatIndex , formatString ) ;
public class CmsNewResourceBuilder { /** * Triggers the resource creation . < p > * @ return the created resource * @ throws CmsException if something goes wrong */ public CmsResource createResource ( ) throws CmsException { } }
String path = OpenCms . getResourceManager ( ) . getNameGenerator ( ) . getNewFileName ( m_cms , m_pathWithPattern , 5 , m_explorerNameGeneration ) ; Locale contentLocale = OpenCms . getLocaleManager ( ) . getDefaultLocale ( m_cms , CmsResource . getFolderPath ( path ) ) ; CmsRequestContext context = m_cms . getRequestContext ( ) ; if ( m_modelResource != null ) { context . setAttribute ( CmsRequestContext . ATTRIBUTE_MODEL , m_modelResource . getRootPath ( ) ) ; } context . setAttribute ( CmsRequestContext . ATTRIBUTE_NEW_RESOURCE_LOCALE , contentLocale ) ; CmsResource res = m_cms . createResource ( path , OpenCms . getResourceManager ( ) . getResourceType ( m_type ) , null , new ArrayList < CmsProperty > ( ) ) ; if ( m_propChanges != null ) { CmsPropertyEditorHelper helper = new CmsPropertyEditorHelper ( m_cms ) ; helper . overrideStructureId ( res . getStructureId ( ) ) ; helper . saveProperties ( m_propChanges ) ; } // Path or other metadata may have changed m_createdResource = m_cms . readResource ( res . getStructureId ( ) , CmsResourceFilter . IGNORE_EXPIRATION ) ; try { m_cms . unlockResource ( m_createdResource ) ; } catch ( CmsException e ) { LOG . info ( e . getLocalizedMessage ( ) , e ) ; } for ( I_Callback callback : m_callbacks ) { callback . onResourceCreated ( this ) ; } return m_createdResource ;
public class SortContext { /** * Sort the given list by using the given property to evaluate against * each element in the list comparing the resulting values . For example , * if the object list contained User instances that had a lastName * property , then you could sort the list by last name via : * < code > sort ( users , ' lastName ' , false ) < / code > . This ensures that each * element in the list is of the given type and uses the given type to * perform the property lookup and evaluation . * @ param list The list to sort * @ param type The type of elements in the array * @ param property The name of the property on the elements to sort against * @ param reverse The state of whether to reverse the order */ @ SuppressWarnings ( "unchecked" ) public void sort ( List < ? > list , Class < ? > type , String property , boolean reverse ) { } }
BeanComparator comparator = newBeanComparator ( type , property , reverse ) ; Collections . sort ( list , comparator ) ;
public class DescribeInstancePatchStatesForPatchGroupResult { /** * The high - level patch state for the requested instances . * @ param instancePatchStates * The high - level patch state for the requested instances . */ public void setInstancePatchStates ( java . util . Collection < InstancePatchState > instancePatchStates ) { } }
if ( instancePatchStates == null ) { this . instancePatchStates = null ; return ; } this . instancePatchStates = new com . amazonaws . internal . SdkInternalList < InstancePatchState > ( instancePatchStates ) ;
public class NumberMath { /** * For this operation , consider the operands independently . Throw an exception if the right operand * ( shift distance ) is not an integral type . For the left operand ( shift value ) also require an integral * type , but do NOT promote from Integer to Long . This is consistent with Java , and makes sense for the * shift operators . */ public static Number leftShift ( Number left , Number right ) { } }
if ( isFloatingPoint ( right ) || isBigDecimal ( right ) ) { throw new UnsupportedOperationException ( "Shift distance must be an integral type, but " + right + " (" + right . getClass ( ) . getName ( ) + ") was supplied" ) ; } return getMath ( left ) . leftShiftImpl ( left , right ) ;
public class SerializationUtils { /** * Deserialize / read a { @ link State } instance from a file . * @ param fs the { @ link FileSystem } instance for opening the file * @ param jobStateFilePath the path to the file * @ param state an empty { @ link State } instance to deserialize into * @ param < T > the { @ link State } object type * @ throws IOException if it fails to deserialize the { @ link State } instance */ public static < T extends State > void deserializeState ( FileSystem fs , Path jobStateFilePath , T state ) throws IOException { } }
try ( InputStream is = fs . open ( jobStateFilePath ) ) { deserializeStateFromInputStream ( is , state ) ; }
public class PublicanPODocBookBuilder { /** * Add an entry to a PO file . * @ param tag The XML element name . * @ param source The original source string . * @ param translation The translated string . * @ param fuzzy If the translation is fuzzy . * @ param poFile The PO file to add to . */ protected void addPOEntry ( final String tag , final String source , final String translation , final boolean fuzzy , final StringBuilder poFile ) { } }
// perform a check to make sure the source isn ' t an empty string , as this could be the case after removing the comments if ( source == null || source . length ( ) == 0 ) return ; poFile . append ( "\n" ) ; if ( ! isNullOrEmpty ( tag ) ) { poFile . append ( "#. Tag: " ) . append ( tag ) . append ( "\n" ) ; } if ( fuzzy ) { poFile . append ( "#, fuzzy\n" ) ; } poFile . append ( "#, no-c-format\n" ) . append ( "msgid \"" ) . append ( escapeForPOFile ( source , true ) ) . append ( "\"\n" ) . append ( "msgstr \"" ) . append ( escapeForPOFile ( translation , false ) ) . append ( "\"\n" ) ;
public class Label { /** * Number of total { @ link Executor } s that belong to this label that are functioning . * This excludes executors that belong to offline nodes . */ @ Exported public int getTotalExecutors ( ) { } }
int r = 0 ; for ( Node n : getNodes ( ) ) { Computer c = n . toComputer ( ) ; if ( c != null && c . isOnline ( ) ) r += c . countExecutors ( ) ; } return r ;
public class SSD1306MessageFactory { /** * Setup page start and end address . < br > * This command is only for horizontal or vertical addressing mode . * @ param startAddress Page start Address , range : 0-7 * @ param endAddress Page end Address , range : 0-7 * @ return command sequence */ public static byte [ ] setPageAddress ( byte startAddress , byte endAddress ) { } }
if ( startAddress < 0 || startAddress > 7 || endAddress < 0 || endAddress > 7 ) { throw new IllegalArgumentException ( "Start and end address must be between 0 and 7." ) ; } return new byte [ ] { COMMAND_CONTROL_BYTE , SET_PAGE_ADDR , COMMAND_CONTROL_BYTE , startAddress , COMMAND_CONTROL_BYTE , endAddress } ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link GeodeticDatumType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link GeodeticDatumType } { @ code > } */ @ XmlElementDecl ( namespace = "http://www.opengis.net/gml" , name = "GeodeticDatum" , substitutionHeadNamespace = "http://www.opengis.net/gml" , substitutionHeadName = "_Datum" ) public JAXBElement < GeodeticDatumType > createGeodeticDatum ( GeodeticDatumType value ) { } }
return new JAXBElement < GeodeticDatumType > ( _GeodeticDatum_QNAME , GeodeticDatumType . class , null , value ) ;
public class LexTokenReader { /** * Read a simple identifier without a module name prefix . * @ return a simple name . */ private String rdIdentifier ( ) { } }
StringBuilder id = new StringBuilder ( ) ; id . append ( ch ) ; while ( restOfName ( rdCh ( ) ) ) { id . append ( ch ) ; } return id . toString ( ) ;
public class RuleImpl { /** * Retrieve the set of all < i > root fact object < / i > parameter * < code > Declarations < / code > . * @ return The Set of < code > Declarations < / code > in order which specify the * < i > root fact objects < / i > . */ @ SuppressWarnings ( "unchecked" ) public Map < String , Declaration > getDeclarations ( ) { } }
if ( this . dirty || ( this . declarations == null ) ) { this . declarations = this . getExtendedLhs ( this , null ) . getOuterDeclarations ( ) ; this . dirty = false ; } return this . declarations ;
public class VEvent { /** * Overrides default copy method to add support for copying alarm sub - components . * @ return a copy of the instance * @ throws ParseException where values in the instance cannot be parsed * @ throws IOException where values in the instance cannot be read * @ throws URISyntaxException where an invalid URI value is encountered in the instance * @ see net . fortuna . ical4j . model . Component # copy ( ) */ public Component copy ( ) throws ParseException , IOException , URISyntaxException { } }
final VEvent copy = ( VEvent ) super . copy ( ) ; copy . alarms = new ComponentList < VAlarm > ( alarms ) ; return copy ;
public class ParserRegistry { /** * Serializes a full configuration to an { @ link OutputStream } * @ param os the output stream where the configuration should be serialized to * @ param globalConfiguration the global configuration . Can be null * @ param configurations a map of named configurations * @ throws XMLStreamException */ public void serialize ( OutputStream os , GlobalConfiguration globalConfiguration , Map < String , Configuration > configurations ) throws XMLStreamException { } }
BufferedOutputStream output = new BufferedOutputStream ( os ) ; XMLStreamWriter subWriter = XMLOutputFactory . newInstance ( ) . createXMLStreamWriter ( output ) ; XMLExtendedStreamWriter writer = new XMLExtendedStreamWriterImpl ( subWriter ) ; serialize ( writer , globalConfiguration , configurations ) ; subWriter . close ( ) ;
public class RestClientUtil { /** * 发送es restful sql请求 / _ xpack / sql , 获取返回值 , 返回值类型由beanType决定 * @ param beanType * @ param entity * @ param < T > * @ return * @ throws ElasticSearchException */ public < T > T sqlObject ( Class < T > beanType , String entity ) throws ElasticSearchException { } }
SQLRestResponse result = this . client . executeRequest ( "/_xpack/sql" , entity , new SQLRestResponseHandler ( ) ) ; return ResultUtil . buildSQLObject ( result , beanType ) ;
public class RemoteCORBAObjectInstanceImpl { /** * ( non - Javadoc ) * @ see com . ibm . ws . clientcontainer . remote . common . object . RemoteObjectInstance # getObject ( com . ibm . ws . serialization . SerializationService ) */ @ Override public Object getObject ( ) throws RemoteObjectInstanceException { } }
Object object ; ClassLoader tccl = AccessController . doPrivileged ( new PrivilegedAction < ClassLoader > ( ) { @ Override public ClassLoader run ( ) { return Thread . currentThread ( ) . getContextClassLoader ( ) ; } } ) ; try { Class < ? > interfaceToNarrowTo = Class . forName ( interfaceNameToNarrowTo , false , tccl ) ; object = PortableRemoteObject . narrow ( remoteObject , interfaceToNarrowTo ) ; } catch ( ClassNotFoundException ex ) { throw new RemoteObjectInstanceException ( "Failed to find class " + interfaceNameToNarrowTo + " from classloader: " + tccl , ex ) ; } catch ( ClassCastException ex ) { throw new RemoteObjectInstanceException ( "Unable to narrow remote object to " + interfaceNameToNarrowTo , ex ) ; } return object ;
public class SipServletRequestImpl { /** * ( non - Javadoc ) * @ see javax . servlet . sip . SipServletRequest # createResponse ( int , java . lang . String ) */ public SipServletResponse createResponse ( final int statusCode , final String reasonPhrase ) { } }
return createResponse ( statusCode , reasonPhrase , true , false ) ;
public class DescribeWorkspacesResult { /** * Information about the WorkSpaces . * Because < a > CreateWorkspaces < / a > is an asynchronous operation , some of the returned information could be * incomplete . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setWorkspaces ( java . util . Collection ) } or { @ link # withWorkspaces ( java . util . Collection ) } if you want to * override the existing values . * @ param workspaces * Information about the WorkSpaces . < / p > * Because < a > CreateWorkspaces < / a > is an asynchronous operation , some of the returned information could be * incomplete . * @ return Returns a reference to this object so that method calls can be chained together . */ public DescribeWorkspacesResult withWorkspaces ( Workspace ... workspaces ) { } }
if ( this . workspaces == null ) { setWorkspaces ( new com . amazonaws . internal . SdkInternalList < Workspace > ( workspaces . length ) ) ; } for ( Workspace ele : workspaces ) { this . workspaces . add ( ele ) ; } return this ;
public class StringUtils { /** * Repeat string . * @ param c the c * @ param count the count * @ return the string */ public static String repeat ( char c , int count ) { } }
StringBuilder builder = new StringBuilder ( ) ; for ( int i = 0 ; i < count ; i ++ ) { builder . append ( c ) ; } return builder . toString ( ) ;
public class ChainLight { /** * Applies attached body initial transform to all lights rays */ void applyAttachment ( ) { } }
if ( body == null || staticLight ) return ; restorePosition . setToTranslation ( bodyPosition ) ; rotateAroundZero . setToRotationRad ( bodyAngle + bodyAngleOffset ) ; for ( int i = 0 ; i < rayNum ; i ++ ) { tmpVec . set ( startX [ i ] , startY [ i ] ) . mul ( rotateAroundZero ) . mul ( restorePosition ) ; startX [ i ] = tmpVec . x ; startY [ i ] = tmpVec . y ; tmpVec . set ( endX [ i ] , endY [ i ] ) . mul ( rotateAroundZero ) . mul ( restorePosition ) ; endX [ i ] = tmpVec . x ; endY [ i ] = tmpVec . y ; }
public class HTODInvalidationBuffer { /** * Call this method to check whether a specified id exists in the invalidation explicit or scan buffer . * @ param id * - cache id . * @ return boolean - true means a specified id is found . */ protected synchronized boolean contains ( Object id ) { } }
boolean found = false ; if ( this . explicitBuffer . containsKey ( id ) || this . scanBuffer . contains ( id ) ) { found = true ; } return found ;
public class Role { /** * Filters the scopes corresponding to a type * @ param < S > the type of the scope to filter . * @ param scopeType the type of scope * @ return the scopes of the given type */ @ SuppressWarnings ( "unchecked" ) public < S extends Scope > Set < S > getScopesByType ( Class < S > scopeType ) { } }
Set < S > typedScopes = new HashSet < > ( ) ; for ( Scope scope : getScopes ( ) ) { if ( scopeType . isInstance ( scope ) ) { typedScopes . add ( ( S ) scope ) ; } } return typedScopes ;
public class HttpsConnectorFactory { /** * Given a list of protocols available to the JVM that we can serve up to the client , partition * this list into two groups : a group of protocols we can serve and a group where we can ' t . This * list takes into account protocols that may have been disabled at the JVM level , and also * protocols that the user explicitly wants to include / exclude . The exclude list ( blacklist ) * is stronger than include list ( whitelist ) , so a protocol that is in both lists will be * excluded . Other than the initial list of available protocols , the other lists are patterns , * such that one can exclude all SSL protocols with a single exclude entry of " SSL . * " . This * function will handle both cipher suites and protocols , but for the sake of conciseness , this * documentation only talks about protocols . This implementation is a slimmed down version from * jetty : * https : / / github . com / eclipse / jetty . project / blob / 93a8afcc6bd1a6e0af7bd9f967c97ae1bc3eb718 / jetty - util / src / main / java / org / eclipse / jetty / util / ssl / SslSelectionDump . java * @ param supportedByJVM protocols available to the JVM . * @ param enabledByJVM protocols enabled by lib / security / java . security . * @ param excludedByConfig protocols the user doesn ' t want to expose . * @ param includedByConfig the only protocols the user wants to expose . * @ return two entry map of protocols that are enabled ( true ) and those that have been disabled ( false ) . */ static Map < Boolean , List < String > > partitionSupport ( String [ ] supportedByJVM , String [ ] enabledByJVM , String [ ] excludedByConfig , String [ ] includedByConfig ) { } }
final List < Pattern > enabled = Arrays . stream ( enabledByJVM ) . map ( Pattern :: compile ) . collect ( Collectors . toList ( ) ) ; final List < Pattern > disabled = Arrays . stream ( excludedByConfig ) . map ( Pattern :: compile ) . collect ( Collectors . toList ( ) ) ; final List < Pattern > included = Arrays . stream ( includedByConfig ) . map ( Pattern :: compile ) . collect ( Collectors . toList ( ) ) ; return Arrays . stream ( supportedByJVM ) . sorted ( Comparator . naturalOrder ( ) ) . collect ( Collectors . partitioningBy ( x -> disabled . stream ( ) . noneMatch ( pat -> pat . matcher ( x ) . matches ( ) ) && enabled . stream ( ) . anyMatch ( pat -> pat . matcher ( x ) . matches ( ) ) && ( included . isEmpty ( ) || included . stream ( ) . anyMatch ( pat -> pat . matcher ( x ) . matches ( ) ) ) ) ) ;
public class Document { /** * Overwrites the form fields for this document . This is useful when * manually migrating form fields from a template . * @ param formFields List * @ throws HelloSignException thrown if there is a problem adding the * FormFields to this Document . */ public void setFormFields ( List < FormField > formFields ) throws HelloSignException { } }
clearList ( DOCUMENT_FORM_FIELDS ) ; for ( FormField formField : formFields ) { addFormField ( formField ) ; }
public class HttpResourceHandler { /** * Fetches the HttpMethod from annotations and returns String representation of HttpMethod . * Return emptyString if not present . * @ param method Method handling the http request . * @ return String representation of HttpMethod from annotations or emptyString as a default . */ private Set < HttpMethod > getHttpMethods ( Method method ) { } }
Set < HttpMethod > httpMethods = new HashSet < > ( ) ; if ( method . isAnnotationPresent ( GET . class ) ) { httpMethods . add ( HttpMethod . GET ) ; } if ( method . isAnnotationPresent ( PUT . class ) ) { httpMethods . add ( HttpMethod . PUT ) ; } if ( method . isAnnotationPresent ( POST . class ) ) { httpMethods . add ( HttpMethod . POST ) ; } if ( method . isAnnotationPresent ( DELETE . class ) ) { httpMethods . add ( HttpMethod . DELETE ) ; } return Collections . unmodifiableSet ( httpMethods ) ;
public class ListUtil { /** * returns count of items in the list * @ param list * @ param delimiter * @ return list len */ public static int len ( String list , String delimiter , boolean ignoreEmpty ) { } }
if ( delimiter . length ( ) == 1 ) return len ( list , delimiter . charAt ( 0 ) , ignoreEmpty ) ; char [ ] del = delimiter . toCharArray ( ) ; int len = StringUtil . length ( list ) ; if ( len == 0 ) return 0 ; int count = 0 ; int last = 0 ; char c ; for ( int i = 0 ; i < len ; i ++ ) { c = list . charAt ( i ) ; for ( int y = 0 ; y < del . length ; y ++ ) { if ( c == del [ y ] ) { if ( ! ignoreEmpty || last < i ) count ++ ; last = i + 1 ; break ; } } } if ( ! ignoreEmpty || last < len ) count ++ ; return count ;
public class Director { /** * Finds all assets matching the search string and the specified type . * If type is AssetType . all then all matching assets will be returned . * @ param searchStr the search string * @ param type the assetType to search for * @ return Map of Resource type to repository resouce lists of assets matching the search string and asset type * @ throws InstallException */ public Map < ResourceType , List < RepositoryResource > > queryAssets ( String searchStr , AssetType type ) throws InstallException { } }
Map < ResourceType , List < RepositoryResource > > results = new HashMap < ResourceType , List < RepositoryResource > > ( ) ; List < RepositoryResource > addOns = new ArrayList < RepositoryResource > ( ) ; List < RepositoryResource > features = new ArrayList < RepositoryResource > ( ) ; List < RepositoryResource > samples = new ArrayList < RepositoryResource > ( ) ; List < RepositoryResource > openSources = new ArrayList < RepositoryResource > ( ) ; RepositoryConnectionList loginInfo = getResolveDirector ( ) . getRepositoryConnectionList ( null , null , null , this . getClass ( ) . getCanonicalName ( ) + ".queryAssets" ) ; try { Collection < ProductDefinition > pdList = new ArrayList < ProductDefinition > ( ) ; for ( ProductInfo pi : ProductInfo . getAllProductInfo ( ) . values ( ) ) { pdList . add ( new ProductInfoProductDefinition ( pi ) ) ; } if ( type . equals ( AssetType . all ) || type . equals ( AssetType . addon ) ) { log ( Level . FINE , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "MSG_SEARCHING_ADDONS" ) ) ; List < ResourceType > tList = new ArrayList < ResourceType > ( 1 ) ; tList . add ( ResourceType . FEATURE ) ; addOns . addAll ( loginInfo . findResources ( searchStr , pdList , tList , Visibility . INSTALL ) ) ; } if ( type . equals ( AssetType . all ) || type . equals ( AssetType . feature ) ) { log ( Level . FINE , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "MSG_SEARCHING_FEATURES" ) ) ; List < ResourceType > tList = new ArrayList < ResourceType > ( 1 ) ; tList . add ( ResourceType . FEATURE ) ; features . addAll ( loginInfo . findResources ( searchStr , pdList , tList , Visibility . PUBLIC ) ) ; } if ( type . equals ( AssetType . all ) || type . equals ( AssetType . sample ) ) { log ( Level . FINE , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "MSG_SEARCHING_SAMPLES" ) ) ; List < ResourceType > tList = new ArrayList < ResourceType > ( 1 ) ; tList . add ( ResourceType . PRODUCTSAMPLE ) ; samples . addAll ( loginInfo . findResources ( searchStr , pdList , tList , Visibility . PUBLIC ) ) ; } if ( type . equals ( AssetType . all ) || type . equals ( AssetType . opensource ) ) { log ( Level . FINE , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "MSG_SEARCHING_OPENSOURCE" ) ) ; List < ResourceType > tList = new ArrayList < ResourceType > ( 1 ) ; tList . add ( ResourceType . OPENSOURCE ) ; openSources . addAll ( loginInfo . findResources ( searchStr , pdList , tList , Visibility . PUBLIC ) ) ; } log ( Level . FINE , "" ) ; } catch ( ProductInfoParseException pipe ) { throw ExceptionUtils . create ( pipe ) ; } catch ( DuplicateProductInfoException dpie ) { throw ExceptionUtils . create ( dpie ) ; } catch ( ProductInfoReplaceException pire ) { throw ExceptionUtils . create ( pire ) ; } catch ( RepositoryException re ) { throw ExceptionUtils . create ( re , re . getCause ( ) , getResolveDirector ( ) . getProxy ( ) , getResolveDirector ( ) . defaultRepo ( ) ) ; } if ( ! addOns . isEmpty ( ) ) results . put ( ResourceType . ADDON , addOns ) ; if ( ! features . isEmpty ( ) ) results . put ( ResourceType . FEATURE , features ) ; if ( ! samples . isEmpty ( ) ) results . put ( ResourceType . PRODUCTSAMPLE , samples ) ; if ( ! openSources . isEmpty ( ) ) results . put ( ResourceType . OPENSOURCE , openSources ) ; return results ;
public class DefaultStreamTokenizer { /** * Checks , if any prebuffered tokens left , otherswise checks underlying stream * @ return */ @ Override public boolean hasMoreTokens ( ) { } }
log . info ( "Tokens size: [" + tokens . size ( ) + "], position: [" + position . get ( ) + "]" ) ; if ( ! tokens . isEmpty ( ) ) return position . get ( ) < tokens . size ( ) ; else return streamHasMoreTokens ( ) ;
public class PathMatchingResourcePatternResolver { /** * Recursively retrieve files that match the given pattern , * adding them to the given result list . * @ param fullPattern the pattern to match against , * with prepended root directory path * @ param dir the current directory * @ param result the Set of matching File instances to add to * @ throws IOException if directory contents could not be retrieved */ protected void doRetrieveMatchingFiles ( String fullPattern , File dir , Set < File > result ) throws IOException { } }
File [ ] dirContents = dir . listFiles ( ) ; if ( dirContents == null ) { return ; } for ( File content : dirContents ) { String currPath = content . getAbsolutePath ( ) . replace ( File . separator , "/" ) ; if ( content . isDirectory ( ) && getPathMatcher ( ) . matchStart ( fullPattern , currPath + "/" ) ) { if ( content . canRead ( ) ) { doRetrieveMatchingFiles ( fullPattern , content , result ) ; } } if ( getPathMatcher ( ) . match ( fullPattern , currPath ) ) { result . add ( content ) ; } }
public class ReportUtil { /** * Get expression elements from report layout * @ param layout * report layout * @ return list of expression elements from report layout */ public static List < ExpressionBean > getExpressions ( ReportLayout layout ) { } }
List < ExpressionBean > expressions = new LinkedList < ExpressionBean > ( ) ; for ( Band band : layout . getBands ( ) ) { for ( int i = 0 , rows = band . getRowCount ( ) ; i < rows ; i ++ ) { List < BandElement > list = band . getRow ( i ) ; for ( BandElement be : list ) { if ( be instanceof ExpressionBandElement ) { if ( ! expressions . contains ( ( ExpressionBandElement ) be ) ) { expressions . add ( new ExpressionBean ( ( ExpressionBandElement ) be , band . getName ( ) ) ) ; } } } } } return expressions ;
public class CmsExplorer { /** * Generates the footer of the explorer initialization code . < p > * @ param numberOfPages the number of pages * @ param selectedPage the selected page to display * @ return js code for initializing the explorer view * @ see # getInitializationHeader ( ) * @ see # getInitializationEntry ( CmsResourceUtil , boolean , boolean , boolean , boolean , boolean , boolean , boolean , boolean , boolean , boolean ) */ public String getInitializationFooter ( int numberOfPages , int selectedPage ) { } }
StringBuffer content = new StringBuffer ( 1024 ) ; content . append ( "top.dU(document," ) ; content . append ( numberOfPages ) ; content . append ( "," ) ; content . append ( selectedPage ) ; content . append ( "); \n" ) ; // display eventual error message if ( getSettings ( ) . getErrorMessage ( ) != null ) { // display error message as JavaScript alert content . append ( "alert(\"" ) ; content . append ( CmsStringUtil . escapeJavaScript ( getSettings ( ) . getErrorMessage ( ) . key ( getLocale ( ) ) ) ) ; content . append ( "\");\n" ) ; // delete error message container in settings getSettings ( ) . setErrorMessage ( null ) ; } // display eventual broadcast message ( s ) String message = getBroadcastMessageString ( ) ; if ( CmsStringUtil . isNotEmpty ( message ) ) { // display broadcast as JavaScript alert content . append ( "alert(decodeURIComponent(\"" ) ; // the user has pending messages , display them all content . append ( CmsEncoder . escapeWBlanks ( message , CmsEncoder . ENCODING_UTF_8 ) ) ; content . append ( "\"));\n" ) ; } content . append ( "}\n" ) ; return content . toString ( ) ;
public class MessageDigestUtilImpl { /** * 获取指定算法对应的MessageDigest * @ param algorithms 算法 * @ return MessageDigest */ private MessageDigest getMessageDigest ( Algorithms algorithms ) { } }
try { return MessageDigest . getInstance ( algorithms . getAlgorithms ( ) ) ; } catch ( NoSuchAlgorithmException exception ) { throw new SecureException ( "当前系统没有指定的算法提供者:[" + "" + "]" , exception ) ; }
public class GoogleAnalyticsRequest { /** * < div class = " ind " > * Optional . * < p > Each custom dimension has an associated index . There is a maximum of 20 custom dimensions ( 200 for Premium accounts ) . The name suffix must be a positive integer between 1 and 200 , inclusive . < / p > * < table border = " 1 " > * < tbody > * < tr > * < th > Parameter < / th > * < th > Value Type < / th > * < th > Default Value < / th > * < th > Max Length < / th > * < th > Supported Hit Types < / th > * < / tr > * < tr > * < td > < code > cd [ 1-9 ] [ 0-9 ] * < / code > < / td > * < td > text < / td > * < td > < span class = " none " > None < / span > * < / td > * < td > 150 Bytes * < / td > * < td > all < / td > * < / tr > * < / tbody > * < / table > * < div > * Example value : < code > Sports < / code > < br > * Example usage : < code > cd [ 1-9 ] [ 0-9 ] * = Sports < / code > * < / div > * < / div > */ public T customDimension ( int index , String value ) { } }
customDimentions . put ( "cd" + index , value ) ; return ( T ) this ;
public class PropertiesUtil { /** * Resolve the given value with the given properties . */ public static String resolve ( String value , Map < String , String > properties ) { } }
do { int i = value . indexOf ( "${" ) ; if ( i < 0 ) return value ; int j = value . indexOf ( '}' , i + 2 ) ; if ( j < 0 ) return value ; String name = value . substring ( i + 2 , j ) ; String val = properties . get ( name ) ; if ( val == null ) val = "" ; value = value . substring ( 0 , i ) + val + value . substring ( j + 1 ) ; } while ( true ) ;
public class CollectionUtil { /** * List转换 * @ param fromList * @ param function * @ return */ public static < F , T > List < T > transform ( Collection < F > fromList , Function < ? super F , ? extends T > function ) { } }
if ( CollectionUtil . isEmpty ( fromList ) ) { return Collections . emptyList ( ) ; } List < T > ret = new ArrayList < T > ( fromList . size ( ) ) ; for ( F f : fromList ) { T t = function . apply ( f ) ; if ( t == null ) { continue ; } ret . add ( t ) ; } return ret ;
public class AWSDatabaseMigrationServiceClient { /** * Modifies the specified endpoint . * @ param modifyEndpointRequest * @ return Result of the ModifyEndpoint operation returned by the service . * @ throws InvalidResourceStateException * The resource is in a state that prevents it from being used for database migration . * @ throws ResourceNotFoundException * The resource could not be found . * @ throws ResourceAlreadyExistsException * The resource you are attempting to create already exists . * @ throws KMSKeyNotAccessibleException * AWS DMS cannot access the KMS key . * @ throws AccessDeniedException * AWS DMS was denied access to the endpoint . Check that the role is correctly configured . * @ sample AWSDatabaseMigrationService . ModifyEndpoint * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / dms - 2016-01-01 / ModifyEndpoint " target = " _ top " > AWS API * Documentation < / a > */ @ Override public ModifyEndpointResult modifyEndpoint ( ModifyEndpointRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeModifyEndpoint ( request ) ;
public class IOUtil { /** * check if given encoding is ok * @ param encoding * @ throws PageException */ public static void checkEncoding ( String encoding ) throws IOException { } }
try { URLEncoder . encode ( "" , encoding ) ; } catch ( UnsupportedEncodingException e ) { throw new IOException ( "invalid encoding [" + encoding + "]" ) ; }
public class Log { /** * set the value file * @ param file value to set * @ throws ApplicationException */ public void setFile ( String file ) throws ApplicationException { } }
if ( StringUtil . isEmpty ( file ) ) return ; if ( file . indexOf ( '/' ) != - 1 || file . indexOf ( '\\' ) != - 1 ) throw new ApplicationException ( "value [" + file + "] from attribute [file] at tag [log] can only contain a filename, file separators like [\\/] are not allowed" ) ; if ( ! file . endsWith ( ".log" ) ) file += ".log" ; this . file = file ;
public class JavaSourceUtils { /** * 合并枚举常量集合 */ public static List < EnumConstantDeclaration > mergeEnumConstants ( List < EnumConstantDeclaration > one , List < EnumConstantDeclaration > two ) { } }
if ( isAllNull ( one , two ) ) return null ; List < EnumConstantDeclaration > ecds = null ; if ( isAllNotNull ( one , two ) ) { ecds = new ArrayList < > ( ) ; List < EnumConstantDeclaration > notMatched = new ArrayList < > ( ) ; notMatched . addAll ( two ) ; for ( EnumConstantDeclaration outer : one ) { boolean found = false ; for ( Iterator < EnumConstantDeclaration > iterator = notMatched . iterator ( ) ; iterator . hasNext ( ) ; ) { EnumConstantDeclaration inner = iterator . next ( ) ; if ( inner . getName ( ) . equals ( outer . getName ( ) ) ) { ecds . add ( mergeEnumConstant ( outer , inner ) ) ; found = true ; iterator . remove ( ) ; } } if ( ! found ) { ecds . add ( outer ) ; LOG . info ( "add EnumConstantDeclaration --> {}" , outer . getName ( ) ) ; } } for ( EnumConstantDeclaration inner : notMatched ) { ecds . add ( inner ) ; LOG . info ( "add EnumConstantDeclaration --> {}" , inner . getName ( ) ) ; } } else { ecds = findFirstNotNull ( one , two ) ; for ( EnumConstantDeclaration ecd : ecds ) { LOG . info ( "add EnumConstantDeclaration --> {}" , ecd . getName ( ) ) ; } } return ecds ;
public class OGraphDatabase { /** * Retrieves the outgoing edges of vertex iVertex having the requested properties iProperties * @ param iVertex * Target vertex * @ param iProperties * Map where keys are property names and values the expected values * @ return */ public Set < OIdentifiable > getOutEdgesHavingProperties ( final OIdentifiable iVertex , Iterable < String > iProperties ) { } }
final ODocument vertex = iVertex . getRecord ( ) ; checkVertexClass ( vertex ) ; return filterEdgesByProperties ( ( OMVRBTreeRIDSet ) vertex . field ( VERTEX_FIELD_OUT ) , iProperties ) ;
public class Transform3D { /** * Set the position . * This function changes only the elements of * the matrix related to the translation . * The scaling and the shearing are not changed . * After a call to this function , the matrix will * contains ( ? means any value ) : * < pre > * < / pre > * @ param x * @ param y * @ param z * @ see # makeTranslationMatrix ( double , double , double ) */ public void setTranslation ( double x , double y , double z ) { } }
this . m03 = x ; this . m13 = y ; this . m23 = z ;
public class InvocationManager { /** * Returns the invocation cache hit count . */ public long getInvocationCacheHitCount ( ) { } }
LruCache < Object , I > invocationCache = _invocationCache ; if ( invocationCache != null ) { return invocationCache . getHitCount ( ) ; } else { return 0 ; }
public class L { /** * < p > < b > DEBUG : < / b > This level of logging should be used to further note what is happening on the device that * could be relevant to investigate and debug unexpected behaviors . You should log only what is needed to gather * enough information about what is going on about your component . If your debug logs are dominating the log then * you probably should be using verbose logging . < / p > * < p > < b > This level is NOT logged in release build . < / b > < / p > */ public static void d ( String msg , Throwable cause ) { } }
if ( BuildConfig . DEBUG ) { Log . d ( LOG_TAG , msg , cause ) ; }
public class Connection { /** * { @ inheritDoc } */ public void setClientInfo ( final String name , final String value ) throws SQLClientInfoException { } }
if ( this . closed ) { throw new SQLClientInfoException ( ) ; } // end of if this . clientInfo . put ( name , value ) ;
public class DateInterval { /** * / * [ deutsch ] * < p > Erzeugt ein unbegrenztes Intervall bis zum angegebenen * Endedatum . < / p > * @ param end date of upper boundary ( inclusive ) * @ return new date interval * @ since 2.0 */ public static DateInterval until ( PlainDate end ) { } }
Boundary < PlainDate > past = Boundary . infinitePast ( ) ; return new DateInterval ( past , Boundary . of ( CLOSED , end ) ) ;
public class RoleAssignmentsInner { /** * Creates a role assignment . * @ param scope The scope of the role assignment to create . The scope can be any REST resource instance . For example , use ' / subscriptions / { subscription - id } / ' for a subscription , ' / subscriptions / { subscription - id } / resourceGroups / { resource - group - name } ' for a resource group , and ' / subscriptions / { subscription - id } / resourceGroups / { resource - group - name } / providers / { resource - provider } / { resource - type } / { resource - name } ' for a resource . * @ param roleAssignmentName The name of the role assignment to create . It can be any valid GUID . * @ param parameters Parameters for the role assignment . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the RoleAssignmentInner object if successful . */ public RoleAssignmentInner create ( String scope , String roleAssignmentName , RoleAssignmentCreateParameters parameters ) { } }
return createWithServiceResponseAsync ( scope , roleAssignmentName , parameters ) . toBlocking ( ) . single ( ) . body ( ) ;
public class TabularSummaryOutput { /** * { @ inheritDoc } */ @ Override public void visitBenchmark ( final BenchmarkResult benchRes ) { } }
final int numberOfColumns = 9 ; NiceTable table = new NiceTable ( numberOfColumns ) ; table = generateHeader ( table ) ; for ( final AbstractMeter meter : benchRes . getRegisteredMeters ( ) ) { table . addHeader ( meter . getName ( ) , '=' , Alignment . Center ) ; for ( final ClassResult classRes : benchRes . getIncludedResults ( ) ) { table . addHeader ( classRes . getElementName ( ) , '.' , Alignment . Left ) ; for ( final MethodResult methRes : classRes . getIncludedResults ( ) ) { table = generateMeterResult ( methRes . getElementName ( ) , meter , methRes , table ) ; } table . addHeader ( new StringBuilder ( "Summary for " ) . append ( classRes . getElementName ( ) ) . toString ( ) , '_' , Alignment . Left ) ; table = generateMeterResult ( "" , meter , classRes , table ) ; table . addLine ( '-' ) ; } } table . addHeader ( "Summary for the whole benchmark" , '=' , Alignment . Center ) ; for ( final AbstractMeter meter : benchRes . getRegisteredMeters ( ) ) { table = generateMeterResult ( "" , meter , benchRes , table ) ; } table . addHeader ( "Exceptions" , '=' , Alignment . Center ) ; for ( final AbstractPerfidixMethodException exec : benchRes . getExceptions ( ) ) { final StringBuilder execBuilder0 = new StringBuilder ( ) ; execBuilder0 . append ( "Related exception: " ) . append ( exec . getExec ( ) . getClass ( ) . getSimpleName ( ) ) ; table . addHeader ( execBuilder0 . toString ( ) , ' ' , Alignment . Left ) ; final StringBuilder execBuilder1 = new StringBuilder ( ) ; if ( exec instanceof PerfidixMethodInvocationException ) { execBuilder1 . append ( "Related place: method invocation" ) ; } else { execBuilder1 . append ( "Related place: method check" ) ; } table . addHeader ( execBuilder1 . toString ( ) , ' ' , Alignment . Left ) ; if ( exec . getMethod ( ) != null ) { final StringBuilder execBuilder2 = new StringBuilder ( ) ; execBuilder2 . append ( "Related method: " ) . append ( exec . getMethod ( ) . getName ( ) ) ; table . addHeader ( execBuilder2 . toString ( ) , ' ' , Alignment . Left ) ; } final StringBuilder execBuilder3 = new StringBuilder ( ) ; execBuilder3 . append ( "Related annotation: " ) . append ( exec . getRelatedAnno ( ) . getSimpleName ( ) ) ; table . addHeader ( execBuilder3 . toString ( ) , ' ' , Alignment . Left ) ; table . addLine ( '-' ) ; } table . addLine ( '=' ) ; out . println ( table . toString ( ) ) ;
public class CmsNewResourceXmlPage { /** * Returns a sorted Map of all available body files of the OpenCms modules . < p > * @ param cms the current cms object * @ param currWpPath the current path in the OpenCms workplace * @ return a sorted map with the body file title as key and absolute path to the body file as value * @ throws CmsException if reading a folder or file fails */ public static TreeMap < String , String > getBodies ( CmsObject cms , String currWpPath ) throws CmsException { } }
return getElements ( cms , CmsWorkplace . VFS_DIR_DEFAULTBODIES , currWpPath , true ) ;
public class CmsSystemInfo { /** * Returns the context for static resources served from the class path , e . g . " / opencms / opencms / handleStatic " . < p > * @ return the static resource context */ public String getStaticResourceContext ( ) { } }
if ( m_staticResourcePathFragment == null ) { m_staticResourcePathFragment = CmsStaticResourceHandler . getStaticResourceContext ( OpenCms . getStaticExportManager ( ) . getVfsPrefix ( ) , getVersionNumber ( ) ) ; } return m_staticResourcePathFragment ;
public class UploadObjectObserver { /** * Notified from * { @ link AmazonS3EncryptionClient # uploadObject ( UploadObjectRequest ) } to * initiate a multi - part upload . * @ param req * the upload object request * @ return the initiated multi - part uploadId */ public String onUploadInitiation ( UploadObjectRequest req ) { } }
InitiateMultipartUploadResult res = s3 . initiateMultipartUpload ( newInitiateMultipartUploadRequest ( req ) ) ; return this . uploadId = res . getUploadId ( ) ;
public class PDFView { /** * Place the minimap current rectangle considering the minimap bounds * the zoom level , and the current X / Y offsets */ private void calculateMinimapAreaBounds ( ) { } }
if ( minimapBounds == null ) { return ; } if ( zoom == 1f ) { miniMapRequired = false ; } else { // Calculates the bounds of the current displayed area float x = ( - currentXOffset - toCurrentScale ( currentFilteredPage * optimalPageWidth ) ) / toCurrentScale ( optimalPageWidth ) * minimapBounds . width ( ) ; float width = getWidth ( ) / toCurrentScale ( optimalPageWidth ) * minimapBounds . width ( ) ; float y = - currentYOffset / toCurrentScale ( optimalPageHeight ) * minimapBounds . height ( ) ; float height = getHeight ( ) / toCurrentScale ( optimalPageHeight ) * minimapBounds . height ( ) ; minimapScreenBounds = new RectF ( minimapBounds . left + x , minimapBounds . top + y , minimapBounds . left + x + width , minimapBounds . top + y + height ) ; minimapScreenBounds . intersect ( minimapBounds ) ; miniMapRequired = true ; }
public class JavacState { /** * Return those files belonging to prev , but not now . */ private Set < Source > calculateRemovedSources ( ) { } }
Set < Source > removed = new HashSet < > ( ) ; for ( String src : prev . sources ( ) . keySet ( ) ) { if ( now . sources ( ) . get ( src ) == null ) { removed . add ( prev . sources ( ) . get ( src ) ) ; } } return removed ;
public class BasePersistence { /** * { @ inheritDoc } */ @ Override public List < T > findByNamedQuery ( String queryName , Object ... params ) { } }
return getPersistenceProvider ( ) . findByNamedQuery ( persistenceClass , queryName , params ) ;
public class ScoreSettingsService { /** * Generate Score Criteria Settings from Score Settings */ public final void generateDashboardScoreSettings ( ) { } }
ScoreCriteriaSettings dashboardScoreCriteriaSettings = new ScoreCriteriaSettings ( ) ; dashboardScoreCriteriaSettings . setMaxScore ( this . scoreSettings . getMaxScore ( ) ) ; dashboardScoreCriteriaSettings . setType ( ScoreValueType . DASHBOARD ) ; dashboardScoreCriteriaSettings . setComponentAlert ( ComponentAlert . cloneComponentAlert ( this . scoreSettings . getComponentAlert ( ) ) ) ; dashboardScoreCriteriaSettings . setBuild ( BuildScoreSettings . cloneBuildScoreSettings ( this . scoreSettings . getBuildWidget ( ) ) ) ; dashboardScoreCriteriaSettings . setDeploy ( DeployScoreSettings . cloneDeployScoreSettings ( this . scoreSettings . getDeployWidget ( ) ) ) ; dashboardScoreCriteriaSettings . setQuality ( QualityScoreSettings . cloneQualityScoreSettings ( this . scoreSettings . getQualityWidget ( ) ) ) ; dashboardScoreCriteriaSettings . setScm ( ScmScoreSettings . cloneScmScoreSettings ( this . scoreSettings . getScmWidget ( ) ) ) ; LOGGER . debug ( "Generate Score Dashboard Settings dashboardScoreCriteriaSettings {}" , dashboardScoreCriteriaSettings ) ; this . dashboardScoreCriteriaSettings = dashboardScoreCriteriaSettings ;
public class SystemConfiguration { /** * Returns for given < code > _ key < / code > the related value as Properties . If * no attribute is found an empty Properties is returned . * Can concatenates Properties for Keys . < br / > * e . b . Key , Key01 , Key02 , Key03 * @ param _ key key of searched attribute * @ param _ concatenate concatenate or not * @ return map with properties * @ throws EFapsException on error */ public Properties getAttributeValueAsProperties ( final String _key , final boolean _concatenate ) throws EFapsException { } }
final Properties ret = new Properties ( ) ; final String value = getAttributeValue ( _key ) ; if ( value != null ) { try { ret . load ( new StringReader ( value ) ) ; } catch ( final IOException e ) { throw new EFapsException ( SystemConfiguration . class , "getAttributeValueAsProperties" , e ) ; } } if ( _concatenate ) { for ( int i = 1 ; i < 100 ; i ++ ) { final String keyTmp = _key + String . format ( "%02d" , i ) ; final String valueTmp = getAttributeValue ( keyTmp ) ; final Properties propsTmp = new Properties ( ) ; if ( valueTmp != null ) { try { propsTmp . load ( new StringReader ( valueTmp ) ) ; } catch ( final IOException e ) { throw new EFapsException ( SystemConfiguration . class , "getAttributeValueAsPropertiesConcat" , e ) ; } } else { break ; } if ( propsTmp . isEmpty ( ) ) { break ; } else { ret . putAll ( propsTmp ) ; } } } return ret ;
public class Neighbour { /** * Marks all the proxies from this Neighbour . * This is used for resynching the state between what this * ME has registered and what the ME has sent . */ void markAllProxies ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "markAllProxies" ) ; final Enumeration enu = iProxies . elements ( ) ; // Cycle through each of the proxies while ( enu . hasMoreElements ( ) ) { final MESubscription sub = ( MESubscription ) enu . nextElement ( ) ; // Mark the subscription . sub . mark ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "markAllProxies" ) ;
public class Crouton { /** * Creates a { @ link Crouton } with provided text - resource and style for a given * activity and displays it directly . * @ param activity * The { @ link Activity } that the { @ link Crouton } should be attached * to . * @ param textResourceId * The resource id of the text you want to display . * @ param style * The style that this { @ link Crouton } should be created with . */ public static void showText ( Activity activity , int textResourceId , Style style ) { } }
showText ( activity , activity . getString ( textResourceId ) , style ) ;
public class MonthDay { /** * Returns a copy of this month - day with the specified chronology . * This instance is immutable and unaffected by this method call . * This method retains the values of the fields , thus the result will * typically refer to a different instant . * The time zone of the specified chronology is ignored , as MonthDay * operates without a time zone . * @ param newChronology the new chronology , null means ISO * @ return a copy of this month - day with a different chronology , never null * @ throws IllegalArgumentException if the values are invalid for the new chronology */ public MonthDay withChronologyRetainFields ( Chronology newChronology ) { } }
newChronology = DateTimeUtils . getChronology ( newChronology ) ; newChronology = newChronology . withUTC ( ) ; if ( newChronology == getChronology ( ) ) { return this ; } else { MonthDay newMonthDay = new MonthDay ( this , newChronology ) ; newChronology . validate ( newMonthDay , getValues ( ) ) ; return newMonthDay ; }
public class CmsAfterPublishStaticExportHandler { /** * Exports all template resources found in a list of published resources . < p > * @ param cms the cms context , in the root site as Export user * @ param publishedTemplateResources list of potential candidates to export * @ param report an I _ CmsReport instance to print output message , or null to write messages to the log file */ protected void exportTemplateResources ( CmsObject cms , List < String > publishedTemplateResources , I_CmsReport report ) { } }
CmsStaticExportManager manager = OpenCms . getStaticExportManager ( ) ; int size = publishedTemplateResources . size ( ) ; int count = 1 ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_EXPORT_TEMPLATES_1 , new Integer ( size ) ) ) ; } report . println ( Messages . get ( ) . container ( Messages . RPT_STATICEXPORT_TEMPLATE_RESOURCES_BEGIN_0 ) , I_CmsReport . FORMAT_HEADLINE ) ; StringBuffer cookies = new StringBuffer ( ) ; // now loop through all of them and request them from the server Iterator < String > i = publishedTemplateResources . iterator ( ) ; while ( i . hasNext ( ) ) { String rfsName = i . next ( ) ; CmsStaticExportData data = null ; try { data = manager . getVfsNameInternal ( cms , rfsName ) ; } catch ( CmsVfsResourceNotFoundException e ) { String rfsBaseName = rfsName ; int pos = rfsName . lastIndexOf ( '_' ) ; if ( pos >= 0 ) { rfsBaseName = rfsName . substring ( 0 , pos ) ; } try { data = manager . getVfsNameInternal ( cms , rfsBaseName ) ; } catch ( CmsVfsResourceNotFoundException e2 ) { if ( LOG . isInfoEnabled ( ) ) { LOG . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_NO_INTERNAL_VFS_RESOURCE_FOUND_1 , new String [ ] { rfsName } ) ) ; } } } if ( data != null ) { data . setRfsName ( rfsName ) ; report . print ( org . opencms . report . Messages . get ( ) . container ( org . opencms . report . Messages . RPT_SUCCESSION_2 , new Integer ( count ++ ) , new Integer ( size ) ) , I_CmsReport . FORMAT_NOTE ) ; report . print ( Messages . get ( ) . container ( Messages . RPT_EXPORTING_0 ) , I_CmsReport . FORMAT_NOTE ) ; report . print ( org . opencms . report . Messages . get ( ) . container ( org . opencms . report . Messages . RPT_ARGUMENT_1 , rfsName ) ) ; report . print ( org . opencms . report . Messages . get ( ) . container ( org . opencms . report . Messages . RPT_DOTS_0 ) ) ; } else { // no valid resource found for rfs name ( already deleted ) , skip it continue ; } try { CmsResource resource = data . getResource ( ) ; try { Collection < String > detailPages = CmsDetailPageUtil . getAllDetailPagesWithUrlName ( cms , resource ) ; for ( String detailPageUri : detailPages ) { String altRfsName = manager . getRfsName ( cms , detailPageUri ) ; CmsStaticExportData detailData = new CmsStaticExportData ( data . getVfsName ( ) , altRfsName , data . getResource ( ) , data . getParameters ( ) ) ; exportTemplateResource ( detailData , cookies ) ; } } catch ( CmsException e ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } int status = exportTemplateResource ( data , cookies ) ; // write the report if ( status == HttpServletResponse . SC_OK ) { report . println ( org . opencms . report . Messages . get ( ) . container ( org . opencms . report . Messages . RPT_OK_0 ) , I_CmsReport . FORMAT_OK ) ; } else if ( status == HttpServletResponse . SC_NOT_MODIFIED ) { report . println ( org . opencms . report . Messages . get ( ) . container ( org . opencms . report . Messages . RPT_SKIPPED_0 ) , I_CmsReport . FORMAT_NOTE ) ; } else if ( status == HttpServletResponse . SC_SEE_OTHER ) { report . println ( org . opencms . report . Messages . get ( ) . container ( org . opencms . report . Messages . RPT_IGNORED_0 ) , I_CmsReport . FORMAT_NOTE ) ; } else { report . println ( org . opencms . report . Messages . get ( ) . container ( org . opencms . report . Messages . RPT_ARGUMENT_1 , new Integer ( status ) ) , I_CmsReport . FORMAT_OK ) ; } } catch ( IOException e ) { report . println ( e ) ; } // don ' t lock up the CPU exclusively - allow other Threads to run as well Thread . yield ( ) ; } report . println ( Messages . get ( ) . container ( Messages . RPT_STATICEXPORT_TEMPLATE_RESOURCES_END_0 ) , I_CmsReport . FORMAT_HEADLINE ) ;
public class DefaultConsistentHashFactory { /** * Merges two consistent hash objects that have the same number of segments , numOwners and hash function . * For each segment , the primary owner of the first CH has priority , the other primary owners become backups . */ @ Override public DefaultConsistentHash union ( DefaultConsistentHash dch1 , DefaultConsistentHash dch2 ) { } }
return dch1 . union ( dch2 ) ;
public class TransitionSet { /** * Sets the play order of this set ' s child transitions . * @ param ordering { @ link # ORDERING _ TOGETHER } to play this set ' s child * transitions together , { @ link # ORDERING _ SEQUENTIAL } to play the child * transitions in sequence . * @ return This transitionSet object . */ @ NonNull public TransitionSet setOrdering ( int ordering ) { } }
switch ( ordering ) { case ORDERING_SEQUENTIAL : mPlayTogether = false ; break ; case ORDERING_TOGETHER : mPlayTogether = true ; break ; default : throw new AndroidRuntimeException ( "Invalid parameter for TransitionSet " + "ordering: " + ordering ) ; } return this ;