signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class MetadataManager { /** * Gets a counter metadata by name . * @ param name * @ return */ public CounterMetadata getCounterMetadata ( String counterName ) { } }
// first fetch metadata for the specified counter String jsonString = getRow ( counterName ) ; if ( jsonString != null ) { CounterMetadata result = CounterMetadata . fromJsonString ( jsonString ) ; if ( result != null ) { result . setName ( counterName ) ; } return result ; } else { // no exact match , try to build counter metadata from global config return findCounterMetadata ( counterName ) ; }
public class ApiOvhIp { /** * Get this object properties * REST : GET / ip / { ip } / game / { ipOnGame } / rule / { id } * @ param ip [ required ] * @ param ipOnGame [ required ] * @ param id [ required ] ID of the rule */ public OvhGameMitigationRule ip_game_ipOnGame_rule_id_GET ( String ip , String ipOnGame , Long id ) throws IOException { } }
String qPath = "/ip/{ip}/game/{ipOnGame}/rule/{id}" ; StringBuilder sb = path ( qPath , ip , ipOnGame , id ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhGameMitigationRule . class ) ;
public class TransactionsPayoutOperations { /** * Retrieve the resume of the transactions of the given payoutid . * @ param payoutId * The payoutid . * @ return The transactions resume . * @ throws OpenpayServiceException * If the service returns an error * @ throws ServiceUnavailableException * If the service is not available */ public TransactionsPayoutResume getResume ( final String payoutId ) throws OpenpayServiceException , ServiceUnavailableException { } }
String path = String . format ( PAYOUT_TRANSACTIONS_PATH , this . getMerchantId ( ) , payoutId ) ; return this . getJsonClient ( ) . get ( path , TransactionsPayoutResume . class ) ;
public class PropertiesReader { /** * Reads a duration property . * @ param property The property name . * @ param defaultValue The default value to return if the property is not present * @ return The property value . */ public Duration getDuration ( String property , Duration defaultValue ) { } }
return getProperty ( property , defaultValue , value -> { try { return Durations . of ( value ) ; } catch ( NumberFormatException e ) { throw new ConfigurationException ( "malformed property value: " + property + " must be a number" ) ; } } ) ;
public class MineBugHistory { /** * This is how dump ( ) was implemented up to and including version 0.9.5. */ public void dumpOriginal ( PrintStream out ) { } }
out . println ( "seq\tversion\ttime\tclasses\tNCSS\tadded\tnewCode\tfixed\tremoved\tretained\tdead\tactive" ) ; for ( int i = 0 ; i < versionList . length ; ++ i ) { Version version = versionList [ i ] ; AppVersion appVersion = sequenceToAppVersionMap . get ( version . getSequence ( ) ) ; out . print ( i ) ; out . print ( '\t' ) ; out . print ( appVersion != null ? appVersion . getReleaseName ( ) : "" ) ; out . print ( '\t' ) ; if ( formatDates ) { out . print ( "\"" + ( appVersion != null ? dateFormat . format ( new Date ( appVersion . getTimestamp ( ) ) ) : "" ) + "\"" ) ; } else { out . print ( appVersion != null ? appVersion . getTimestamp ( ) / 1000 : 0L ) ; } out . print ( '\t' ) ; if ( appVersion != null ) { out . print ( appVersion . getNumClasses ( ) ) ; out . print ( '\t' ) ; out . print ( appVersion . getCodeSize ( ) ) ; } else { out . print ( "\t0\t0" ) ; } for ( int j = 0 ; j < TUPLE_SIZE ; ++ j ) { out . print ( '\t' ) ; out . print ( version . get ( j ) ) ; } out . println ( ) ; }
public class ScanWriterGenerator { /** * Creates a scan writer for the given destination . */ public ScanWriter createScanWriter ( int taskId , ScanDestination destination ) { } }
if ( destination . isDiscarding ( ) ) { return _scanWriterFactory . createDiscardingScanWriter ( taskId , Optional . < Integer > absent ( ) ) ; } URI uri = destination . getUri ( ) ; String scheme = uri . getScheme ( ) ; if ( "file" . equals ( scheme ) ) { return _scanWriterFactory . createFileScanWriter ( taskId , uri , Optional . < Integer > absent ( ) ) ; } if ( "s3" . equals ( scheme ) ) { return _scanWriterFactory . createS3ScanWriter ( taskId , uri , Optional . < Integer > absent ( ) ) ; } throw new IllegalArgumentException ( "Unsupported destination: " + destination ) ;
public class ListUtils { /** * Divides the given list using the boundaries in < code > cuts < / code > . < br > * Cuts are interpreted in an inclusive way , which means that a single cut * at position i divides the given list in 0 . . . i - 1 + i . . . n < br > * This method deals with both cut positions including and excluding start index 0 . < br > * @ param < T > * Type of list elements * @ param list * The list to divide * @ param positions * Cut positions for divide operations * @ return A list of sublists of < code > list < / code > according to the given * cut positions */ public static < T > List < List < T > > divideListPos ( List < T > list , Integer ... positions ) { } }
Arrays . sort ( positions ) ; if ( positions [ 0 ] < 0 || positions [ positions . length - 1 ] > list . size ( ) - 1 ) throw new IllegalArgumentException ( ) ; Integer [ ] positionsInternal = null ; boolean containsZeroIndex = positions [ 0 ] == 0 ; if ( containsZeroIndex ) { if ( positions . length == 1 ) return new ArrayList < > ( Arrays . asList ( list ) ) ; positionsInternal = Arrays . copyOfRange ( positions , 1 , positions . length ) ; } else { positionsInternal = positions ; } int numPositions = positionsInternal . length ; // System . out . println ( " Positions : " + Arrays . toString ( positionsInternal ) ) ; List < List < T > > result = new ArrayList < > ( numPositions + 1 ) ; int lastEndIndex = 0 ; for ( int i = 0 ; i < numPositions ; i ++ ) { // System . out . println ( " consider cut position " + positionsInternal [ i ] ) ; int startIndex = lastEndIndex + ( result . isEmpty ( ) ? 0 : 1 ) ; int endIndex = positionsInternal [ i ] - 1 ; // System . out . println ( " start index : " + startIndex ) ; // System . out . println ( " end index : " + endIndex ) ; result . add ( copyOfRange ( list , startIndex , endIndex ) ) ; lastEndIndex = endIndex ; } if ( lastEndIndex < list . size ( ) - 1 ) { result . add ( copyOfRange ( list , lastEndIndex + 1 , list . size ( ) - 1 ) ) ; } return result ;
public class WexAdapters { /** * Adapts a WexTicker to a Ticker Object * @ param bTCETicker * @ return */ public static Ticker adaptTicker ( WexTicker bTCETicker , CurrencyPair currencyPair ) { } }
BigDecimal last = bTCETicker . getLast ( ) ; BigDecimal bid = bTCETicker . getSell ( ) ; BigDecimal ask = bTCETicker . getBuy ( ) ; BigDecimal high = bTCETicker . getHigh ( ) ; BigDecimal low = bTCETicker . getLow ( ) ; BigDecimal avg = bTCETicker . getAvg ( ) ; BigDecimal volume = bTCETicker . getVolCur ( ) ; Date timestamp = DateUtils . fromMillisUtc ( bTCETicker . getUpdated ( ) * 1000L ) ; return new Ticker . Builder ( ) . currencyPair ( currencyPair ) . last ( last ) . bid ( bid ) . ask ( ask ) . high ( high ) . low ( low ) . vwap ( avg ) . volume ( volume ) . timestamp ( timestamp ) . build ( ) ;
public class WSCallbackHandlerFactoryImpl { /** * { @ inheritDoc } */ @ Override public CallbackHandler getCallbackHandler ( String userName , String realmName , @ Sensitive String password ) { } }
AuthenticationData authenticationData = createBasicAuthenticationData ( userName , password ) ; authenticationData . set ( AuthenticationData . REALM , realmName ) ; return new AuthenticationDataCallbackHandler ( authenticationData ) ;
public class TunnelClient { /** * Stop the client , disconnecting any servers . * @ throws IOException in case of I / O errors */ public void stop ( ) throws IOException { } }
synchronized ( this . monitor ) { if ( this . serverThread != null ) { this . serverThread . close ( ) ; try { this . serverThread . join ( 2000 ) ; } catch ( InterruptedException ex ) { Thread . currentThread ( ) . interrupt ( ) ; } this . serverThread = null ; } }
public class BooleanList { /** * Creates an returns an unmodifiable view of the given boolean array that requires * only a small object allocation . * @ param array the array to wrap into an unmodifiable list * @ param length the number of values of the array to use , starting from zero * @ return an unmodifiable list view of the array */ public static List < Boolean > unmodifiableView ( boolean [ ] array , int length ) { } }
return Collections . unmodifiableList ( view ( array , length ) ) ;
public class UsageProvider { /** * Displays usage . * @ param cmdLineSyntax * the string that will be displayed on top of the usage message * @ param options * the command options */ public static void displayUsage ( String cmdLineSyntax , Options options ) { } }
HelpFormatter helpFormatter = new HelpFormatter ( ) ; helpFormatter . printHelp ( cmdLineSyntax , options ) ;
public class BindDataSourceBuilder { /** * Extract dao field name for internal data source . * @ param dao * the dao * @ return the string */ private String extractDaoFieldNameForInternalDataSource ( SQLiteDaoDefinition dao ) { } }
return "_" + CaseFormat . UPPER_CAMEL . to ( CaseFormat . LOWER_CAMEL , dao . getName ( ) ) ;
public class PDBBioAssemblyParser { /** * Set the macromolecularSize fields of the parsed bioassemblies . * This can only be called after the full PDB file has been read so that * all the info for all bioassemblies has been gathered . * Note that an explicit method to set the field is necessary here because * in PDB files the transformations contain only the author chain ids , corresponding * to polymeric chains , whilst in mmCIF files the transformations * contain all asym ids of both polymers and non - polymers . */ public void setMacromolecularSizes ( ) { } }
for ( BioAssemblyInfo bioAssembly : transformationMap . values ( ) ) { bioAssembly . setMacromolecularSize ( bioAssembly . getTransforms ( ) . size ( ) ) ; }
public class PoolManager { /** * The caller of this method must have a lock on the PoolManagers * waiterFreePoolLock object . * @ param subject * @ param cri * @ return * @ throws ResourceAllocationException * @ throws ConnectionWaitTimeoutException */ protected MCWrapper getFreeWaiterConnection ( ManagedConnectionFactory managedConnectionFactory , Subject subject , ConnectionRequestInfo cri ) throws ResourceAllocationException , ConnectionWaitTimeoutException { } }
if ( tc . isEntryEnabled ( ) ) { Tr . entry ( this , tc , "getFreeWaiterConnection" , gConfigProps . cfName ) ; } MCWrapper mcWrapper = null ; MCWrapper mcWrapperTemp = null ; int mcwlSize = mcWrapperWaiterList . size ( ) ; if ( mcwlSize > 0 ) { int mcwlIndex = mcwlSize - 1 ; // Remove the first mcWrapper from the list ( Optimistic ) mcWrapperTemp = ( MCWrapper ) mcWrapperWaiterList . remove ( mcwlIndex ) ; mcWrapperTemp . setPoolState ( 0 ) ; mcWrapper = getMCWrapperFromMatch ( subject , cri , managedConnectionFactory , mcWrapperTemp ) ; if ( ( ( com . ibm . ejs . j2c . MCWrapper ) mcWrapperTemp ) . do_not_reuse_mcw ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "Connection error occurred for this mcw " + mcWrapperTemp + ", mcw will not be reuse" ) ; } freePool [ 0 ] . cleanupAndDestroyMCWrapper ( mcWrapperTemp ) ; if ( ( waiterCount > 0 ) && ( waiterCount > mcWrapperWaiterList . size ( ) ) ) { waiterFreePoolLock . notify ( ) ; } if ( tc . isEntryEnabled ( ) ) { Tr . exit ( this , tc , "getFreeWaiterConnection" , new Object [ ] { "Returning destroyed mcWrapper" , mcWrapperTemp } ) ; } return mcWrapperTemp ; } if ( mcWrapper == null ) { // We need to add the mcWrapper back , we don ' t have a // matching connection mcWrapperWaiterList . add ( mcWrapperTemp ) ; mcWrapperTemp . setPoolState ( 4 ) ; // We need to look through the list , since we didn ' t find a matching connection at // the end of the list , we need to use get and only remove if we find a matching // connection . for ( int i = mcwlIndex - 1 ; i >= 0 ; -- i ) { mcWrapperTemp = ( MCWrapper ) mcWrapperWaiterList . get ( i ) ; mcWrapper = getMCWrapperFromMatch ( subject , cri , managedConnectionFactory , mcWrapperTemp ) ; if ( ( ( com . ibm . ejs . j2c . MCWrapper ) mcWrapperTemp ) . do_not_reuse_mcw ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "Connection error occurred for this mcw " + mcWrapperTemp + ", mcw will not be reuse" ) ; } mcWrapperWaiterList . remove ( i ) ; freePool [ 0 ] . cleanupAndDestroyMCWrapper ( mcWrapperTemp ) ; if ( ( waiterCount > 0 ) && ( waiterCount > mcWrapperWaiterList . size ( ) ) ) { waiterFreePoolLock . notify ( ) ; } if ( tc . isEntryEnabled ( ) ) { Tr . exit ( this , tc , "getFreeWaiterConnection" , new Object [ ] { "Returning destroyed mcWrapper" , mcWrapperTemp } ) ; } return mcWrapperTemp ; } if ( mcWrapper != null ) { mcWrapperWaiterList . remove ( i ) ; mcWrapper . setPoolState ( 0 ) ; break ; } } } // end else } // end if if ( tc . isEntryEnabled ( ) ) { if ( tc . isDebugEnabled ( ) ) { // only print this information if tc . isEntryEnabled ( ) and tc . isDebugEnabled ( ) if ( mcWrapper != null ) { Tr . debug ( this , tc , "Returning mcWrapper " + mcWrapper ) ; } else { Tr . debug ( this , tc , "MCWrapper was not found in Free Pool" ) ; } } Tr . exit ( this , tc , "getFreeWaiterConnection" , mcWrapper ) ; } return mcWrapper ;
public class Blade { /** * Get banner text * @ return return blade start banner text */ public String bannerText ( ) { } }
if ( null != bannerText ) return bannerText ; String bannerPath = environment . get ( ENV_KEY_BANNER_PATH , null ) ; if ( StringKit . isEmpty ( bannerPath ) || Files . notExists ( Paths . get ( bannerPath ) ) ) { return null ; } try { BufferedReader bufferedReader = Files . newBufferedReader ( Paths . get ( bannerPath ) ) ; bannerText = bufferedReader . lines ( ) . collect ( Collectors . joining ( "\r\n" ) ) ; } catch ( Exception e ) { log . error ( "Load Start Banner file error" , e ) ; } return bannerText ;
public class RelatedTablesCoreExtension { /** * Adds a relationship between the base and related table . Creates the user * mapping table if needed . * @ param baseTableName * base table name * @ param relatedTableName * related table name * @ param userMappingTable * user mapping table * @ param relationName * relation name * @ return The relationship that was added */ public ExtendedRelation addRelationship ( String baseTableName , String relatedTableName , UserMappingTable userMappingTable , String relationName ) { } }
// Validate the relation validateRelationship ( baseTableName , relatedTableName , relationName ) ; // Create the user mapping table if needed createUserMappingTable ( userMappingTable ) ; // Add a row to gpkgext _ relations ExtendedRelation extendedRelation = new ExtendedRelation ( ) ; extendedRelation . setBaseTableName ( baseTableName ) ; extendedRelation . setBasePrimaryColumn ( getPrimaryKeyColumnName ( baseTableName ) ) ; extendedRelation . setRelatedTableName ( relatedTableName ) ; extendedRelation . setRelatedPrimaryColumn ( getPrimaryKeyColumnName ( relatedTableName ) ) ; extendedRelation . setMappingTableName ( userMappingTable . getTableName ( ) ) ; extendedRelation . setRelationName ( relationName ) ; try { extendedRelationsDao . create ( extendedRelation ) ; } catch ( SQLException e ) { throw new GeoPackageException ( "Failed to add relationship '" + relationName + "' between " + baseTableName + " and " + relatedTableName , e ) ; } return extendedRelation ;
public class SipServletMessageImpl { /** * ( non - Javadoc ) * @ see javax . servlet . sip . SipServletMessage # setCharacterEncoding ( java . lang . String ) */ public void setCharacterEncoding ( String enc ) throws UnsupportedEncodingException { } }
new String ( "testEncoding" . getBytes ( ) , enc ) ; checkCommitted ( ) ; try { this . message . setContentEncoding ( SipFactoryImpl . headerFactory . createContentEncodingHeader ( enc ) ) ; } catch ( Exception ex ) { throw new UnsupportedEncodingException ( enc ) ; }
public class MathUtil { /** * Replies the secant of the specified angle . * < p > < code > csc ( a ) = 1 / cos ( a ) < / code > * < p > < img src = " . / doc - files / trigo1 . png " alt = " [ Secant function ] " > * < img src = " . / doc - files / trigo2 . png " alt = " [ Secant function ] " > * @ param angle the angle . * @ return the secant of the angle . */ @ Pure @ Inline ( value = "1./Math.cos($1)" , imported = { } }
Math . class } ) public static double sec ( double angle ) { return 1. / Math . cos ( angle ) ;
public class GroupBy { /** * Create a new aggregating set expression using a backing TreeSet * @ param expression values for this expression will be accumulated into a set * @ return wrapper expression */ public static < E extends Comparable < ? super E > > AbstractGroupExpression < E , SortedSet < E > > sortedSet ( Expression < E > expression ) { } }
return GSet . createSorted ( expression ) ;
public class SqlMapper { /** * 删除数据 * @ param sql 执行的sql * @ return 执行行数 */ public int delete ( String sql ) { } }
String msId = msUtils . delete ( sql ) ; return sqlSession . delete ( msId ) ;
public class Auth { /** * Only use QUORUM cl for the default superuser . */ private static ConsistencyLevel consistencyForUser ( String username ) { } }
if ( username . equals ( DEFAULT_SUPERUSER_NAME ) ) return ConsistencyLevel . QUORUM ; else return ConsistencyLevel . LOCAL_ONE ;
public class DefaultAgenda { /** * ( non - Javadoc ) * @ see org . kie . common . AgendaI # clearAgendaGroup ( org . kie . common . AgendaGroupImpl ) */ public void clearAndCancelAgendaGroup ( InternalAgendaGroup agendaGroup ) { } }
// enforce materialization of all activations of this group before removing them for ( Activation activation : agendaGroup . getActivations ( ) ) { ( ( RuleAgendaItem ) activation ) . getRuleExecutor ( ) . reEvaluateNetwork ( this ) ; } final EventSupport eventsupport = this . workingMemory ; agendaGroup . setClearedForRecency ( this . workingMemory . getFactHandleFactory ( ) . getRecency ( ) ) ; // this is thread safe for BinaryHeapQueue // Binary Heap locks while it returns the array and reset ' s it ' s own internal array . Lock is released afer getAndClear ( ) List < RuleAgendaItem > lazyItems = new ArrayList < RuleAgendaItem > ( ) ; for ( Activation aQueueable : agendaGroup . getAndClear ( ) ) { final AgendaItem item = ( AgendaItem ) aQueueable ; if ( item . isRuleAgendaItem ( ) ) { lazyItems . add ( ( RuleAgendaItem ) item ) ; ( ( RuleAgendaItem ) item ) . getRuleExecutor ( ) . cancel ( workingMemory , eventsupport ) ; continue ; } // this must be set false before removal from the activationGroup . // Otherwise the activationGroup will also try to cancel the Actvation // Also modify won ' t work properly item . setQueued ( false ) ; if ( item . getActivationGroupNode ( ) != null ) { item . getActivationGroupNode ( ) . getActivationGroup ( ) . removeActivation ( item ) ; } eventsupport . getAgendaEventSupport ( ) . fireActivationCancelled ( item , this . workingMemory , MatchCancelledCause . CLEAR ) ; } // restore lazy items for ( RuleAgendaItem lazyItem : lazyItems ) { agendaGroup . add ( lazyItem ) ; }
public class Mailbox { /** * Send envelope once at time * @ param envelope envelope * @ param time time */ public void scheduleOnce ( Envelope envelope , long time ) { } }
if ( envelope . getMailbox ( ) != this ) { throw new RuntimeException ( "envelope.mailbox != this mailbox" ) ; } envelopes . putEnvelopeOnce ( envelope , time , comparator ) ;
public class BaseApplet { /** * Get this image . * @ param filename The filename of this image ( if no path , assumes images / buttons ; if not ext assumes . gif ) . * @ param description The image description . * @ return The image . */ public ImageIcon loadImageIcon ( String filename , String description ) { } }
filename = Util . getImageFilename ( filename , "buttons" ) ; URL url = null ; if ( this . getApplication ( ) != null ) url = this . getApplication ( ) . getResourceURL ( filename , this ) ; if ( url == null ) { // Not a resource , try reading it from the disk . try { return new ImageIcon ( filename , description ) ; } catch ( Exception ex ) { // File not found - try a fully qualified URL . ex . printStackTrace ( ) ; return null ; } } return new ImageIcon ( url , description ) ;
public class DecodedBitStreamParser { /** * Numeric Compaction mode ( see 5.4.4 ) permits efficient encoding of numeric data strings . * @ param codewords The array of codewords ( data + error ) * @ param codeIndex The current index into the codeword array . * @ param result The decoded data is appended to the result . * @ return The next index into the codeword array . */ private static int numericCompaction ( int [ ] codewords , int codeIndex , StringBuilder result ) throws FormatException { } }
int count = 0 ; boolean end = false ; int [ ] numericCodewords = new int [ MAX_NUMERIC_CODEWORDS ] ; while ( codeIndex < codewords [ 0 ] && ! end ) { int code = codewords [ codeIndex ++ ] ; if ( codeIndex == codewords [ 0 ] ) { end = true ; } if ( code < TEXT_COMPACTION_MODE_LATCH ) { numericCodewords [ count ] = code ; count ++ ; } else { switch ( code ) { case TEXT_COMPACTION_MODE_LATCH : case BYTE_COMPACTION_MODE_LATCH : case BYTE_COMPACTION_MODE_LATCH_6 : case BEGIN_MACRO_PDF417_CONTROL_BLOCK : case BEGIN_MACRO_PDF417_OPTIONAL_FIELD : case MACRO_PDF417_TERMINATOR : codeIndex -- ; end = true ; break ; } } if ( ( count % MAX_NUMERIC_CODEWORDS == 0 || code == NUMERIC_COMPACTION_MODE_LATCH || end ) && count > 0 ) { // Re - invoking Numeric Compaction mode ( by using codeword 902 // while in Numeric Compaction mode ) serves to terminate the // current Numeric Compaction mode grouping as described in 5.4.4.2, // and then to start a new one grouping . result . append ( decodeBase900toBase10 ( numericCodewords , count ) ) ; count = 0 ; } } return codeIndex ;
public class BGZFSplitCompressionInputStream { /** * Read up to < code > len < / code > bytes from the stream , but no further than the end of the * compressed block . If at the end of the block then no bytes will be read and a return * value of - 2 will be returned ; on the next call to read , bytes from the next block * will be returned . This is the same contract as CBZip2InputStream in Hadoop . * @ return int The return value greater than 0 are the bytes read . A value * of - 1 means end of stream while - 2 represents end of block . */ private int readWithinBlock ( byte [ ] b , int off , int len ) throws IOException { } }
if ( input . endOfBlock ( ) ) { final int available = input . available ( ) ; // this will read the next block , if there is one processedPosition = input . getPosition ( ) >> 16 ; if ( available == 0 ) { // end of stream return - 1 ; } return END_OF_BLOCK ; } // return up to end of block ( at most ) int available = input . available ( ) ; return input . read ( b , off , Math . min ( available , len ) ) ;
public class Timestamp { /** * Creates an instance with current time . */ public static Timestamp now ( ) { } }
java . sql . Timestamp date = new java . sql . Timestamp ( System . currentTimeMillis ( ) ) ; return of ( date ) ;
public class CmsHistoryDriver { /** * Returns the amount of properties for a propertydefinition . < p > * @ param dbc the current database context * @ param metadef the propertydefinition to test * @ param projectId the ID of the current project * @ return the amount of properties for a propertydefinition * @ throws CmsDataAccessException if something goes wrong */ protected int internalCountProperties ( CmsDbContext dbc , CmsPropertyDefinition metadef , CmsUUID projectId ) throws CmsDataAccessException { } }
ResultSet res = null ; PreparedStatement stmt = null ; Connection conn = null ; int returnValue ; try { // create statement conn = m_sqlManager . getConnection ( dbc ) ; stmt = m_sqlManager . getPreparedStatement ( conn , projectId , "C_PROPERTIES_READALL_COUNT" ) ; stmt . setString ( 1 , metadef . getId ( ) . toString ( ) ) ; res = stmt . executeQuery ( ) ; if ( res . next ( ) ) { returnValue = res . getInt ( 1 ) ; while ( res . next ( ) ) { // do nothing only move through all rows because of mssql odbc driver } } else { throw new CmsDbConsistencyException ( Messages . get ( ) . container ( Messages . ERR_NO_PROPERTIES_FOR_PROPERTYDEF_1 , metadef . getName ( ) ) ) ; } } catch ( SQLException e ) { throw new CmsDbSqlException ( Messages . get ( ) . container ( Messages . ERR_GENERIC_SQL_1 , CmsDbSqlException . getErrorQuery ( stmt ) ) , e ) ; } finally { m_sqlManager . closeAll ( dbc , conn , stmt , res ) ; } return returnValue ;
public class OffsetTime { /** * Compares this { @ code OffsetTime } to another time . * The comparison is based first on the UTC equivalent instant , then on the local time . * It is " consistent with equals " , as defined by { @ link Comparable } . * For example , the following is the comparator order : * < ol > * < li > { @ code 10:30 + 01:00 } < / li > * < li > { @ code 11:00 + 01:00 } < / li > * < li > { @ code 12:00 + 02:00 } < / li > * < li > { @ code 11:30 + 01:00 } < / li > * < li > { @ code 12:00 + 01:00 } < / li > * < li > { @ code 12:30 + 01:00 } < / li > * < / ol > * Values # 2 and # 3 represent the same instant on the time - line . * When two values represent the same instant , the local time is compared * to distinguish them . This step is needed to make the ordering * consistent with { @ code equals ( ) } . * To compare the underlying local time of two { @ code TemporalAccessor } instances , * use { @ link ChronoField # NANO _ OF _ DAY } as a comparator . * @ param other the other time to compare to , not null * @ return the comparator value , negative if less , positive if greater * @ throws NullPointerException if { @ code other } is null */ @ Override public int compareTo ( OffsetTime other ) { } }
if ( offset . equals ( other . offset ) ) { return time . compareTo ( other . time ) ; } int compare = Long . compare ( toEpochNano ( ) , other . toEpochNano ( ) ) ; if ( compare == 0 ) { compare = time . compareTo ( other . time ) ; } return compare ;
public class MessageMgr { /** * Reports a message . * @ param message to be reported * @ return true if the message was reported , false otherwise */ protected boolean report ( Message5WH message ) { } }
if ( message == null ) { return false ; } E_MessageType type = message . getType ( ) ; if ( ! this . messageHandlers . containsKey ( message . getType ( ) ) ) { return false ; } MessageTypeHandler handler = this . messageHandlers . get ( message . getType ( ) ) ; String template = this . renderer . render ( message ) ; handler . handleMessage ( template , type , this . max100stg . getInstanceOf ( "max" ) , this . appID ) ; this . messages . put ( template , type ) ; return true ;
public class JAXPExtensionsProvider { /** * Is the extension element available ? */ public boolean elementAvailable ( String ns , String elemName ) throws javax . xml . transform . TransformerException { } }
return false ;
public class OpenCms { /** * Add a cms event listener that listens only to particular events . < p > * @ param listener the listener to add * @ param eventTypes the events to listen for */ public static void addCmsEventListener ( I_CmsEventListener listener , int [ ] eventTypes ) { } }
OpenCmsCore . getInstance ( ) . getEventManager ( ) . addCmsEventListener ( listener , eventTypes ) ;
public class RemoteTopicConnection { /** * / * ( non - Javadoc ) * @ see javax . jms . TopicConnection # createTopicSession ( boolean , int ) */ @ Override public synchronized TopicSession createTopicSession ( boolean transacted , int acknowledgeMode ) throws JMSException { } }
checkNotClosed ( ) ; RemoteTopicSession session = new RemoteTopicSession ( idProvider . createID ( ) , this , transportHub . createEndpoint ( ) , transacted , acknowledgeMode ) ; registerSession ( session ) ; session . remoteInit ( ) ; return session ;
public class BeanDescImpl { @ Override public Object newInstance ( Object [ ] args ) throws BeanConstructorNotFoundException { } }
Constructor < ? > constructor = getSuitableConstructor ( args ) ; return LdiConstructorUtil . newInstance ( constructor , args ) ;
public class Iterate { /** * Returns true if the iterable contains the value . * In the case of Collections and RichIterables , the method contains is called . * All other iterables will force a complete iteration to happen , which can be unnecessarily costly . */ public static boolean contains ( Iterable < ? > iterable , Object value ) { } }
if ( iterable instanceof Collection ) { return ( ( Collection < ? > ) iterable ) . contains ( value ) ; } if ( iterable instanceof RichIterable ) { return ( ( RichIterable < ? > ) iterable ) . contains ( value ) ; } return IterableIterate . detectIndex ( iterable , Predicates . equal ( value ) ) > - 1 ;
public class UIRadioButton { /** * Sets state of this { @ link UIRadioButton } to selected . < br > * If a radio button with the same name is currently selected , unselects it . < br > * Does not fire { @ link SelectEvent } . * @ return the UI radio button */ public UIRadioButton setSelected ( ) { } }
UIRadioButton rb = getSelected ( name ) ; if ( rb != null ) rb . selected = false ; selected = true ; return this ;
public class Autoencoder { /** * Calculates the error between the autoencoder ' s reconstruction of the input and the argument instances . * This error is converted to vote scores . * @ param inst the instance to get votes for * @ return the votes for the instance ' s label [ normal , outlier ] */ @ Override public double [ ] getVotesForInstance ( Instance inst ) { } }
double [ ] votes = new double [ 2 ] ; if ( this . reset == false ) { double error = this . getAnomalyScore ( inst ) ; // Exponential function to convert the error [ 0 , + inf ) into a vote [ 1,0 ] . votes [ 0 ] = Math . pow ( 2.0 , - 1.0 * ( error / this . threshold ) ) ; votes [ 1 ] = 1.0 - votes [ 0 ] ; } return votes ;
public class LocationFactory { /** * Creates JCRPath from parent path and relPath * @ param parentLoc parent path * @ param relPath related path * @ return * @ throws RepositoryException */ public JCRPath createJCRPath ( JCRPath parentLoc , String relPath ) throws RepositoryException { } }
JCRPath addPath = parseNames ( relPath , false ) ; return parentLoc . add ( addPath ) ;
public class DancingLinks { /** * Add a row to the table . * @ param values the columns that are satisfied by this row */ public void addRow ( boolean [ ] values ) { } }
Node < ColumnName > prev = null ; for ( int i = 0 ; i < values . length ; ++ i ) { if ( values [ i ] ) { ColumnHeader < ColumnName > top = columns . get ( i ) ; top . size += 1 ; Node < ColumnName > bottom = top . up ; Node < ColumnName > node = new Node < ColumnName > ( null , null , bottom , top , top ) ; bottom . down = node ; top . up = node ; if ( prev != null ) { Node < ColumnName > front = prev . right ; node . left = prev ; node . right = front ; prev . right = node ; front . left = node ; } else { node . left = node ; node . right = node ; } prev = node ; } }
public class SpreadUtils { /** * For each element of array , generate a question . * @ param args * @ return */ public static < E > String generateQuestion ( Collection < E > args ) { } }
if ( args == null || args . size ( ) == 0 ) return "" ; return generateInternal ( args . size ( ) ) ;
public class DestinationManager { /** * Checks that the Local ME is in the queue point localizing set * @ param queuePointLocalizingMEs */ private void checkQueuePointContainsLocalME ( Set < String > queuePointLocalizingMEs , SIBUuid8 messagingEngineUuid , DestinationDefinition destinationDefinition , LocalizationDefinition destinationLocalizationDefinition ) { } }
if ( isQueue ( destinationDefinition . getDestinationType ( ) ) && ( destinationLocalizationDefinition != null ) ) { // Queue point locality set must contain local ME if ( ( queuePointLocalizingMEs == null ) || ( ! queuePointLocalizingMEs . contains ( messagingEngineUuid . toString ( ) ) ) ) { throw new SIErrorException ( nls . getFormattedMessage ( "INTERNAL_CONFIGURATION_ERROR_CWSIP0006" , new Object [ ] { "DestinationManager" , "1:4845:1.508.1.7" , destinationDefinition . getName ( ) } , null ) ) ; } }
public class Yaml { /** * Load list of instantiated API objects from a stream of data . Returns list of concrete typed * objects ( e . g . { V1Pod , V1SERVICE } ) * < p > Order of API objects in list will be preserved according to order of objects in stream of * data . * @ param reader The stream to load . * @ return List of instantiated of the objects . * @ throws IOException If an error occurs while reading the YAML . */ public static List < Object > loadAll ( Reader reader ) throws IOException { } }
Iterable < Object > iterable = getSnakeYaml ( ) . loadAll ( reader ) ; List < Object > list = new ArrayList < Object > ( ) ; for ( Object object : iterable ) { if ( object != null ) { try { list . add ( modelMapper ( ( Map < String , Object > ) object ) ) ; } catch ( ClassCastException ex ) { logger . error ( "Unexpected exception while casting: " + ex ) ; } } } return list ;
public class TableCollectionManager { /** * Gets the record associated with a specific Row * @ param row The row * @ return The associated record , or null . */ public T getRecordForRow ( Row row ) { } }
Integer recordId = rowToRecordIds . get ( row ) ; if ( recordId == null ) return null ; return getRecordForId ( recordId ) ;
public class ControlMessageFactoryImpl { /** * Create a new , empty ControlCreateStream Message * @ return The new ControlCreateStream * @ exception MessageCreateFailedException Thrown if such a message can not be created */ public final ControlCreateStream createNewControlCreateStream ( ) throws MessageCreateFailedException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createNewControlCreateStream" ) ; ControlCreateStream msg = null ; try { msg = new ControlCreateStreamImpl ( MfpConstants . CONSTRUCTOR_NO_OP ) ; } catch ( MessageDecodeFailedException e ) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createNewControlCreateStream" ) ; return msg ;
public class CmsDriverManager { /** * Reads a property object from a resource specified by a property name . < p > * Returns < code > { @ link CmsProperty # getNullProperty ( ) } < / code > if the property is not found . < p > * @ param dbc the current database context * @ param resource the resource where the property is read from * @ param key the property key name * @ param search if < code > true < / code > , the property is searched on all parent folders of the resource . * if it ' s not found attached directly to the resource . * @ return the required property , or < code > { @ link CmsProperty # getNullProperty ( ) } < / code > if the property was not found * @ throws CmsException if something goes wrong */ public CmsProperty readPropertyObject ( CmsDbContext dbc , CmsResource resource , String key , boolean search ) throws CmsException { } }
// NOTE : Do not call readPropertyObject ( dbc , resource , key , search , null ) for performance reasons // use the list reading method to obtain all properties for the resource List < CmsProperty > properties = readPropertyObjects ( dbc , resource , search ) ; int i = properties . indexOf ( new CmsProperty ( key , null , null ) ) ; if ( i >= 0 ) { // property has been found in the map CmsProperty result = properties . get ( i ) ; // ensure the result value is not frozen return result . cloneAsProperty ( ) ; } return CmsProperty . getNullProperty ( ) ;
public class FlightInfoExtendedBuilder { /** * Sets the { @ link FlightSchedule } object for the current * { @ link FlightInfoExtended } object . This field is mandatory for this * object and can ' t be null . * @ param departureTime * the departure time . It can ' t be null . * @ param arrivalTime * the arrival time . It can ' t be null . * @ param boardingTime * the boarding time . This field is optional . * @ return this builder . */ public FlightInfoExtendedBuilder setFlightSchedule ( Calendar departureTime , Calendar arrivalTime , Calendar boardingTime ) { } }
FlightSchedule flightSchedule = new FlightSchedule ( departureTime , arrivalTime , boardingTime ) ; this . flightInfo . setFlightSchedule ( flightSchedule ) ; return this ;
public class LeadLagAggFunction { /** * TODO hack , use the current input reset the buffer value . */ @ Override public Expression [ ] retractExpressions ( ) { } }
return new Expression [ ] { existDefaultValue ? cast ( operand ( 2 ) , typeLiteral ( getResultType ( ) ) ) : literal ( null , getResultType ( ) ) } ;
public class SecurityManager { /** * Checks if { @ link SecureAccess } is included in the current class context , if so true is returned , else false * @ return true if { @ link SecureAccess } is included in the current class context , else false */ private boolean checkForSecureAccess ( ) { } }
Class [ ] classContext = getClassContext ( ) ; for ( Class clazz : classContext ) { if ( clazz . equals ( SecureAccess . class ) || clazz . equals ( SecurityBreachHandler . class ) || clazz . equals ( SecurityFunctions . class ) || clazz . equals ( SecureStorageImpl . class ) ) { return true ; } } return false ;
public class RequestCreator { /** * Asynchronously fulfills the request into the specified { @ link BitmapTarget } . In most cases , you * should use this when you are dealing with a custom { @ link android . view . View View } or view * holder which should implement the { @ link BitmapTarget } interface . * Implementing on a { @ link android . view . View View } : * < blockquote > < pre > * public class ProfileView extends FrameLayout implements Target { * { @ literal @ } Override public void onBitmapLoaded ( Bitmap bitmap , LoadedFrom from ) { * setBackgroundDrawable ( new BitmapDrawable ( bitmap ) ) ; * { @ literal @ } Override public void onBitmapFailed ( Exception e , Drawable errorDrawable ) { * setBackgroundDrawable ( errorDrawable ) ; * { @ literal @ } Override public void onPrepareLoad ( Drawable placeHolderDrawable ) { * setBackgroundDrawable ( placeHolderDrawable ) ; * < / pre > < / blockquote > * Implementing on a view holder object for use inside of an adapter : * < blockquote > < pre > * public class ViewHolder implements Target { * public FrameLayout frame ; * public TextView name ; * { @ literal @ } Override public void onBitmapLoaded ( Bitmap bitmap , LoadedFrom from ) { * frame . setBackgroundDrawable ( new BitmapDrawable ( bitmap ) ) ; * { @ literal @ } Override public void onBitmapFailed ( Exception e , Drawable errorDrawable ) { * frame . setBackgroundDrawable ( errorDrawable ) ; * { @ literal @ } Override public void onPrepareLoad ( Drawable placeHolderDrawable ) { * frame . setBackgroundDrawable ( placeHolderDrawable ) ; * < / pre > < / blockquote > * To receive callbacks when an image is loaded use * { @ link # into ( android . widget . ImageView , Callback ) } . */ public void into ( @ NonNull BitmapTarget target ) { } }
long started = System . nanoTime ( ) ; checkMain ( ) ; if ( target == null ) { throw new IllegalArgumentException ( "Target must not be null." ) ; } if ( deferred ) { throw new IllegalStateException ( "Fit cannot be used with a Target." ) ; } if ( ! data . hasImage ( ) ) { picasso . cancelRequest ( target ) ; target . onPrepareLoad ( setPlaceholder ? getPlaceholderDrawable ( ) : null ) ; return ; } Request request = createRequest ( started ) ; if ( shouldReadFromMemoryCache ( request . memoryPolicy ) ) { Bitmap bitmap = picasso . quickMemoryCacheCheck ( request . key ) ; if ( bitmap != null ) { picasso . cancelRequest ( target ) ; target . onBitmapLoaded ( bitmap , MEMORY ) ; return ; } } target . onPrepareLoad ( setPlaceholder ? getPlaceholderDrawable ( ) : null ) ; Action action = new BitmapTargetAction ( picasso , target , request , errorDrawable , errorResId ) ; picasso . enqueueAndSubmit ( action ) ;
public class ClassFile { /** * Return external representation of given name , converting ' / ' to ' . ' . * Note : the naming is the inverse of that used by JVMS 4.2 The Internal Form Of Names , * which defines " internal name " to be the form using " / " instead of " . " */ public static byte [ ] externalize ( Name name ) { } }
return externalize ( name . getByteArray ( ) , name . getByteOffset ( ) , name . getByteLength ( ) ) ;
public class FSNamesystem { /** * dumps the contents of recentInvalidateSets */ private void dumpRecentInvalidateSets ( PrintWriter out ) { } }
int size = recentInvalidateSets . values ( ) . size ( ) ; out . println ( "Metasave: Blocks " + pendingDeletionBlocksCount + " waiting deletion from " + size + " datanodes." ) ; if ( size == 0 ) { return ; } for ( Map . Entry < String , LightWeightHashSet < Block > > entry : recentInvalidateSets . entrySet ( ) ) { LightWeightHashSet < Block > blocks = entry . getValue ( ) ; if ( blocks . size ( ) > 0 ) { out . println ( datanodeMap . get ( entry . getKey ( ) ) . getName ( ) + blocks ) ; } }
public class KAFDocument { /** * Creates a Role object to load an existing role . It receives the ID as an argument . It doesn ' t add the role to the predicate . * @ param id role ' s ID . * @ param predicate the predicate which this role is part of * @ param semRole semantic role * @ param span span containing all the targets of the role * @ return a new role . */ public Predicate . Role newRole ( String id , Predicate predicate , String semRole , Span < Term > span ) { } }
idManager . updateCounter ( AnnotationType . ROLE , id ) ; Predicate . Role newRole = new Predicate . Role ( id , semRole , span ) ; return newRole ;
public class CmsSimpleEditor { /** * Decodes the content from the content request parameter . < p > * @ param encodedContent the encoded content * @ param encoding the encoding to use * @ param originalFile the current file state * @ return the decoded content */ protected String decodeContentParameter ( String encodedContent , String encoding , CmsFile originalFile ) { } }
return decodeContent ( encodedContent ) ;
public class PathPatternUtils { /** * Returns < code > true < / code > if a specified path is matched by pattern * and has the same depth in term of JCR path . * @ param pattern * pattern for node path * @ param absPath * node absolute path * @ return a < code > boolean < / code > . */ public static boolean acceptName ( String pattern , String absPath ) { } }
absPath = normalizePath ( absPath ) ; pattern = adopt2JavaPattern ( pattern ) ; return absPath . matches ( pattern ) ;
public class UUID { /** * 返回指定数字对应的hex值 * @ param val 值 * @ param digits 位 * @ return 值 */ private static String digits ( long val , int digits ) { } }
long hi = 1L << ( digits * 4 ) ; return Long . toHexString ( hi | ( val & ( hi - 1 ) ) ) . substring ( 1 ) ;
public class ipsecprofile { /** * Use this API to fetch filtered set of ipsecprofile resources . * filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */ public static ipsecprofile [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } }
ipsecprofile obj = new ipsecprofile ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; ipsecprofile [ ] response = ( ipsecprofile [ ] ) obj . getfiltered ( service , option ) ; return response ;
public class CpuSampler { /** * Get cpu rate information * @ return string show cpu rate information */ public String getCpuRateInfo ( ) { } }
StringBuilder sb = new StringBuilder ( ) ; synchronized ( mCpuInfoEntries ) { for ( Map . Entry < Long , String > entry : mCpuInfoEntries . entrySet ( ) ) { long time = entry . getKey ( ) ; sb . append ( BlockInfo . TIME_FORMATTER . format ( time ) ) . append ( ' ' ) . append ( entry . getValue ( ) ) . append ( BlockInfo . SEPARATOR ) ; } } return sb . toString ( ) ;
public class GlobalUsersInner { /** * Resets the user password on an environment This operation can take a while to complete . * @ param userName The name of the user . * @ param resetPasswordPayload Represents the payload for resetting passwords . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable for the request */ public Observable < Void > resetPasswordAsync ( String userName , ResetPasswordPayload resetPasswordPayload ) { } }
return resetPasswordWithServiceResponseAsync ( userName , resetPasswordPayload ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ;
public class Config { /** * The directory where diagnostic dumps are to be place , null if none should be done . * @ return The directory where diagnostic dumps are to be place , null if none should be done . */ public DiagnosticFileDumper getDiagnosticFileDumper ( ) { } }
if ( diagnosticFileDumper != null ) { return diagnosticFileDumper ; } String dd = sdkProperties . getProperty ( DIAGNOTISTIC_FILE_DIRECTORY ) ; if ( dd != null ) { diagnosticFileDumper = DiagnosticFileDumper . configInstance ( new File ( dd ) ) ; } return diagnosticFileDumper ;
public class MetricMeta { /** * value : component + taskId + streamId + metricType + host + port + metricGroup + metricName */ @ Override public byte [ ] getValue ( ) { } }
StringBuilder sb = new StringBuilder ( 64 ) ; sb . append ( component ) . append ( MetricUtils . AT ) . append ( taskId ) . append ( MetricUtils . AT ) . append ( streamId ) . append ( MetricUtils . AT ) . append ( metricType ) . append ( MetricUtils . AT ) . append ( host ) . append ( MetricUtils . AT ) . append ( port ) . append ( MetricUtils . AT ) . append ( metricGroup ) . append ( MetricUtils . AT ) . append ( metricName ) ; return sb . toString ( ) . getBytes ( ) ;
public class JoiningSequenceReader { /** * Scans through the sequence index arrays in linear time . Not the best * performance but easier to code */ private int linearSearch ( int position ) { } }
int [ ] minSeqIndex = getMinSequenceIndex ( ) ; int [ ] maxSeqIndex = getMaxSequenceIndex ( ) ; int length = minSeqIndex . length ; for ( int i = 0 ; i < length ; i ++ ) { if ( position >= minSeqIndex [ i ] && position <= maxSeqIndex [ i ] ) { return i ; } } throw new IndexOutOfBoundsException ( "Given position " + position + " does not map into this Sequence" ) ;
public class VisitorHelper { /** * Add a invokes relation between two methods . * @ param methodDescriptor * The invoking method . * @ param lineNumber * The line number . * @ param invokedMethodDescriptor * The invoked method . */ void addInvokes ( MethodDescriptor methodDescriptor , final Integer lineNumber , MethodDescriptor invokedMethodDescriptor ) { } }
InvokesDescriptor invokesDescriptor = scannerContext . getStore ( ) . create ( methodDescriptor , InvokesDescriptor . class , invokedMethodDescriptor ) ; invokesDescriptor . setLineNumber ( lineNumber ) ;
public class hafailover { /** * Use this API to Force hafailover . */ public static base_response Force ( nitro_service client , hafailover resource ) throws Exception { } }
hafailover Forceresource = new hafailover ( ) ; Forceresource . force = resource . force ; return Forceresource . perform_operation ( client , "Force" ) ;
public class SetPropertyFieldsRule { /** * Adds a custom parser for the specified named field . */ public void addFieldParser ( String property , FieldParser parser ) { } }
if ( _parsers == null ) { _parsers = new HashMap < String , FieldParser > ( ) ; } _parsers . put ( property , parser ) ;
public class AtomicGrowingSparseHashMatrix { /** * Locks all the row entries for this column , thereby preventing write or * read access to the values . Note that the number of rows to lock * < b > must < / b > be the same value used with { @ link # unlockColumn ( int , int ) } , * otherwise the unlock may potentially unlock matrix entries associated * with this lock call . * @ param col the column to lock * @ param rowsToLock the number of rows to lock . This value should be the * number of { @ link # rows } at the time of the call . */ private void lockColumn ( int col , int rowsToLock ) { } }
// Put in an entry for all the columns ' s rows for ( int row = 0 ; row < rowsToLock ; ++ row ) { Entry e = new Entry ( row , col ) ; // Spin waiting for the entry to be unlocked while ( lockedEntries . putIfAbsent ( e , new Object ( ) ) != null ) ; }
public class DefaultClusterManager { /** * Deploys a verticle . */ private void doDeployVerticle ( final Message < JsonObject > message ) { } }
String main = message . body ( ) . getString ( "main" ) ; if ( main == null ) { message . reply ( new JsonObject ( ) . putString ( "status" , "error" ) . putString ( "message" , "No verticle main specified." ) ) ; return ; } JsonObject config = message . body ( ) . getObject ( "config" ) ; if ( config == null ) { config = new JsonObject ( ) ; } int instances = message . body ( ) . getInteger ( "instances" , 1 ) ; boolean worker = message . body ( ) . getBoolean ( "worker" , false ) ; if ( worker ) { boolean multiThreaded = message . body ( ) . getBoolean ( "multi-threaded" , false ) ; platform . deployWorkerVerticle ( main , config , instances , multiThreaded , createDeploymentHandler ( message ) ) ; } else { platform . deployVerticle ( main , config , instances , createDeploymentHandler ( message ) ) ; }
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link CombinerParametersType } { @ code > } } */ @ XmlElementDecl ( namespace = "urn:oasis:names:tc:xacml:2.0:policy:schema:os" , name = "CombinerParameters" , scope = PolicySetType . class ) public JAXBElement < CombinerParametersType > createPolicySetTypeCombinerParameters ( CombinerParametersType value ) { } }
return new JAXBElement < CombinerParametersType > ( _CombinerParameters_QNAME , CombinerParametersType . class , PolicySetType . class , value ) ;
public class DrawerBuilder { /** * Add a initial DrawerItem or a DrawerItem Array for the StickyDrawerFooter * @ param stickyDrawerItems * @ return */ public DrawerBuilder addStickyDrawerItems ( @ NonNull IDrawerItem ... stickyDrawerItems ) { } }
if ( this . mStickyDrawerItems == null ) { this . mStickyDrawerItems = new ArrayList < > ( ) ; } Collections . addAll ( this . mStickyDrawerItems , stickyDrawerItems ) ; return this ;
public class ClassInfoList { /** * Find the subset of this { @ link ClassInfoList } for which the given filter predicate is true . * @ param filter * The { @ link ClassInfoFilter } to apply . * @ return The subset of this { @ link ClassInfoList } for which the given filter predicate is true . */ public ClassInfoList filter ( final ClassInfoFilter filter ) { } }
final Set < ClassInfo > reachableClassesFiltered = new LinkedHashSet < > ( size ( ) ) ; final Set < ClassInfo > directlyRelatedClassesFiltered = new LinkedHashSet < > ( directlyRelatedClasses . size ( ) ) ; for ( final ClassInfo ci : this ) { if ( filter . accept ( ci ) ) { reachableClassesFiltered . add ( ci ) ; if ( directlyRelatedClasses . contains ( ci ) ) { directlyRelatedClassesFiltered . add ( ci ) ; } } } return new ClassInfoList ( reachableClassesFiltered , directlyRelatedClassesFiltered , sortByName ) ;
public class BusLayerConstants { /** * Set if the bus stops stops with no binding to bus halt * should be drawn or not . * @ param isDrawable is < code > true < / code > if the bus stops name with no binding are drawable ; * < code > false < / code > if the bus stops name with no binding are not drawable ; or < code > null < / code > * if the default value must be restored . */ public static void setBusStopNoHaltBindingDrawable ( Boolean isDrawable ) { } }
final Preferences prefs = Preferences . userNodeForPackage ( BusLayerConstants . class ) ; if ( prefs != null ) { if ( isDrawable == null ) { prefs . remove ( "DRAW_NO_BUS_HALT_BIND" ) ; // $ NON - NLS - 1 $ } else { prefs . putBoolean ( "DRAW_NO_BUS_HALT_BIND" , isDrawable . booleanValue ( ) ) ; // $ NON - NLS - 1 $ } try { prefs . sync ( ) ; } catch ( BackingStoreException exception ) { } }
public class ParsedSelectStmt { /** * Continue adding TVEs from DisplayColumns that are left in * function needComplexAggregation ( ) . * After this function , aggResultColumns construction work . */ private void fillUpAggResultColumns ( ) { } }
for ( ParsedColInfo col : m_displayColumns ) { if ( m_aggResultColumns . contains ( col ) ) { continue ; } if ( col . m_expression instanceof TupleValueExpression ) { m_aggResultColumns . add ( col ) ; } else { // Col must be complex expression ( like : TVE + 1 , TVE + AGG ) List < TupleValueExpression > tveList = new ArrayList < > ( ) ; findAllTVEs ( col . m_expression , tveList ) ; insertTVEsToAggResultColumns ( tveList ) ; } }
public class Async { /** * Convert a synchronous function call into an asynchronous function call through an Observable . * < img width = " 640 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / toAsync . png " alt = " " > * @ param < T1 > the first parameter type * @ param < T2 > the second parameter type * @ param < R > the result type * @ param func the function to convert * @ return a function that returns an Observable that executes the { @ code func } and emits its returned value * @ see < a href = " https : / / github . com / ReactiveX / RxJava / wiki / Async - Operators # wiki - toasync - or - asyncaction - or - asyncfunc " > RxJava Wiki : toAsync ( ) < / a > * @ see < a href = " http : / / msdn . microsoft . com / en - us / library / hh229851 . aspx " > MSDN : Observable . ToAsync < / a > */ public static < T1 , T2 , R > Func2 < T1 , T2 , Observable < R > > toAsync ( Func2 < ? super T1 , ? super T2 , ? extends R > func ) { } }
return toAsync ( func , Schedulers . computation ( ) ) ;
public class GridIndex { /** * Finds a valid ( existing ) trinagle adjacent to a given invalid cell * @ param minInvalidCell minimum bounding box invalid cell * @ return a valid triangle adjacent to the invalid cell */ private Triangle findValidTriangle ( Vector2i minInvalidCell ) { } }
// If the invalid cell is the minimal one in the grid we are forced to search the // triangulation for a trinagle at that location if ( minInvalidCell . getX ( ) == 0 && minInvalidCell . getY ( ) == 0 ) return indexDelaunay . find ( middleOfCell ( minInvalidCell . getX ( ) , minInvalidCell . getY ( ) ) , null ) ; else // Otherwise we can take an adjacent cell triangle that is still valid return grid [ Math . min ( 0 , minInvalidCell . getX ( ) ) ] [ Math . min ( 0 , minInvalidCell . getY ( ) ) ] ;
public class JIT_Stub { /** * Utility method that returns the name of the Stub class that needs to * be generated for the specified remote interface class . Intended for * use by JITDeploy only ( should not be called directly ) . < p > * Basically , the name of the Stub class for any remote interface is * the name of the remote interface class , with an ' _ ' prepended , * and ' _ Stub ' appended . < p > * This method properly modifies the class name with or without * a package qualification . < p > * @ param remoteInterfaceName the fully qualified class name of the * remote interface . */ public static String getStubClassName ( String remoteInterfaceName ) { } }
StringBuilder stubBuilder = new StringBuilder ( remoteInterfaceName ) ; int packageOffset = Math . max ( remoteInterfaceName . lastIndexOf ( '.' ) + 1 , remoteInterfaceName . lastIndexOf ( '$' ) + 1 ) ; stubBuilder . insert ( packageOffset , '_' ) ; stubBuilder . append ( "_Stub" ) ; return stubBuilder . toString ( ) ;
public class ApiOvhIpLoadbalancing { /** * Task for this iplb * REST : GET / ipLoadbalancing / { serviceName } / task * @ param doneDate _ to [ required ] Filter the value of doneDate property ( < = ) * @ param doneDate _ from [ required ] Filter the value of doneDate property ( > = ) * @ param action [ required ] Filter the value of action property ( = ) * @ param creationDate _ to [ required ] Filter the value of creationDate property ( < = ) * @ param creationDate _ from [ required ] Filter the value of creationDate property ( > = ) * @ param status [ required ] Filter the value of status property ( = ) * @ param serviceName [ required ] The internal name of your IP load balancing */ public ArrayList < Long > serviceName_task_GET ( String serviceName , OvhTaskActionEnum action , Date creationDate_from , Date creationDate_to , Date doneDate_from , Date doneDate_to , OvhTaskStatusEnum status ) throws IOException { } }
String qPath = "/ipLoadbalancing/{serviceName}/task" ; StringBuilder sb = path ( qPath , serviceName ) ; query ( sb , "action" , action ) ; query ( sb , "creationDate.from" , creationDate_from ) ; query ( sb , "creationDate.to" , creationDate_to ) ; query ( sb , "doneDate.from" , doneDate_from ) ; query ( sb , "doneDate.to" , doneDate_to ) ; query ( sb , "status" , status ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t2 ) ;
public class THPeerAsPendToAct { /** * ( non - Javadoc ) * @ see org . restcomm . protocols . ss7 . m3ua . impl . fsm . TransitionHandler # process ( org * . mobicents . protocols . ss7 . m3ua . impl . fsm . State ) */ @ Override public boolean process ( FSMState state ) { } }
// Send the PayloadData ( if any ) from pending queue to other side AspImpl causeAsp = ( AspImpl ) this . fsm . getAttribute ( AsImpl . ATTRIBUTE_ASP ) ; this . asImpl . sendPendingPayloadData ( causeAsp ) ; return true ;
public class BshClassPath { /** * Create a proper class name from a messy thing . * Turn / or \ into . , remove leading class and trailing . class * Note : this makes lots of strings . . . could be faster . */ public static String canonicalizeClassName ( String name ) { } }
String classname = name ; if ( classname . startsWith ( "modules/" ) ) classname = classname . replaceFirst ( "^modules/[^/]+/" , "" ) ; classname = classname . replaceAll ( "[/\\\\]" , "." ) ; if ( classname . startsWith ( "." ) ) classname = classname . substring ( 1 ) ; if ( classname . startsWith ( "class " ) ) classname = classname . substring ( 6 ) ; if ( classname . startsWith ( "classes." ) ) classname = classname . substring ( 8 ) ; if ( classname . endsWith ( ".class" ) ) classname = classname . replaceFirst ( "\\.[^\\.]+$" , "" ) ; return classname ;
public class RectangularPrism { /** * Returns the vertices of an n - fold polygon of given radius and center * @ param n * @ param radius * @ param center * @ return */ @ Override public Point3d [ ] getVertices ( ) { } }
double x = 0.5 * width ; double y = 0.5 * height ; double z = 0.5 * length ; Point3d [ ] vertices = new Point3d [ 8 ] ; vertices [ 0 ] = new Point3d ( - x , - y , z ) ; vertices [ 1 ] = new Point3d ( - x , y , z ) ; vertices [ 2 ] = new Point3d ( x , y , z ) ; vertices [ 3 ] = new Point3d ( x , - y , z ) ; vertices [ 4 ] = new Point3d ( - x , - y , - z ) ; vertices [ 5 ] = new Point3d ( - x , y , - z ) ; vertices [ 6 ] = new Point3d ( x , y , - z ) ; vertices [ 7 ] = new Point3d ( x , - y , - z ) ; return vertices ;
public class KeyDecoder { /** * Decodes a signed byte from exactly 1 byte , as encoded for descending * order . * @ param src source of encoded bytes * @ param srcOffset offset into source array * @ return signed byte value */ public static byte decodeByteDesc ( byte [ ] src , int srcOffset ) throws CorruptEncodingException { } }
try { return ( byte ) ( src [ srcOffset ] ^ 0x7f ) ; } catch ( IndexOutOfBoundsException e ) { throw new CorruptEncodingException ( null , e ) ; }
public class AWSCognitoIdentityProviderClient { /** * Updates the name and scopes of resource server . All other fields are read - only . * @ param updateResourceServerRequest * @ return Result of the UpdateResourceServer operation returned by the service . * @ throws InvalidParameterException * This exception is thrown when the Amazon Cognito service encounters an invalid parameter . * @ throws ResourceNotFoundException * This exception is thrown when the Amazon Cognito service cannot find the requested resource . * @ throws NotAuthorizedException * This exception is thrown when a user is not authorized . * @ throws TooManyRequestsException * This exception is thrown when the user has made too many requests for a given operation . * @ throws InternalErrorException * This exception is thrown when Amazon Cognito encounters an internal error . * @ sample AWSCognitoIdentityProvider . UpdateResourceServer * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / cognito - idp - 2016-04-18 / UpdateResourceServer " * target = " _ top " > AWS API Documentation < / a > */ @ Override public UpdateResourceServerResult updateResourceServer ( UpdateResourceServerRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeUpdateResourceServer ( request ) ;
public class Timecode { /** * @ param samples * @ param dropFrame * @ param supportDays * @ return * @ deprecated use method without supportDays ( supportDays is now implicitly true ) or dropFrame ( drop frame timecode is not * correctly supported currently ) */ @ Deprecated public static final Timecode getInstance ( SampleCount samples , boolean dropFrame , boolean supportDays ) { } }
final Timecode timecode = getInstance ( samples , dropFrame ) ; if ( ! supportDays && timecode . getDaysPart ( ) != 0 ) { throw new IllegalArgumentException ( "supportDays disabled but resulting timecode had a days component: " + timecode . toEncodedString ( ) ) ; } else { return timecode ; }
public class NetworkConnectionFactory { /** * Creates a new connection . * @ param destId a destination identifier of NetworkConnectionService . */ @ Override public Connection < T > newConnection ( final Identifier destId ) { } }
final Connection < T > connection = connectionMap . get ( destId ) ; if ( connection == null ) { final Connection < T > newConnection = new NetworkConnection < > ( this , destId ) ; connectionMap . putIfAbsent ( destId , newConnection ) ; return connectionMap . get ( destId ) ; } return connection ;
public class InitiateDocumentVersionUploadRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( InitiateDocumentVersionUploadRequest initiateDocumentVersionUploadRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( initiateDocumentVersionUploadRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( initiateDocumentVersionUploadRequest . getAuthenticationToken ( ) , AUTHENTICATIONTOKEN_BINDING ) ; protocolMarshaller . marshall ( initiateDocumentVersionUploadRequest . getId ( ) , ID_BINDING ) ; protocolMarshaller . marshall ( initiateDocumentVersionUploadRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( initiateDocumentVersionUploadRequest . getContentCreatedTimestamp ( ) , CONTENTCREATEDTIMESTAMP_BINDING ) ; protocolMarshaller . marshall ( initiateDocumentVersionUploadRequest . getContentModifiedTimestamp ( ) , CONTENTMODIFIEDTIMESTAMP_BINDING ) ; protocolMarshaller . marshall ( initiateDocumentVersionUploadRequest . getContentType ( ) , CONTENTTYPE_BINDING ) ; protocolMarshaller . marshall ( initiateDocumentVersionUploadRequest . getDocumentSizeInBytes ( ) , DOCUMENTSIZEINBYTES_BINDING ) ; protocolMarshaller . marshall ( initiateDocumentVersionUploadRequest . getParentFolderId ( ) , PARENTFOLDERID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class Configuration { /** * Get the value of the < code > name < / code > property as a < code > boolean < / code > . * If no such property is specified , or if the specified value is not a valid * < code > boolean < / code > , then < code > defaultValue < / code > is returned . * @ param name property name . * @ param defaultValue default value . * @ return property value as a < code > boolean < / code > , * or < code > defaultValue < / code > . */ public boolean getBoolean ( String name , boolean defaultValue ) { } }
String valueString = getTrimmed ( name ) ; if ( null == valueString || "" . equals ( valueString ) ) { return defaultValue ; } valueString = valueString . toLowerCase ( ) ; if ( "true" . equals ( valueString ) ) { return true ; } else if ( "false" . equals ( valueString ) ) { return false ; } else { return defaultValue ; }
public class Router { /** * This is a hack to deal with the fact that there is currently no custom * serializer for QueryRow . Instead , just convert everything to generic Maps . */ private static void convertCBLQueryRowsToMaps ( Map < String , Object > allDocsResult ) { } }
List < Map < String , Object > > rowsAsMaps = new ArrayList < Map < String , Object > > ( ) ; List < QueryRow > rows = ( List < QueryRow > ) allDocsResult . get ( "rows" ) ; if ( rows != null ) { for ( QueryRow row : rows ) { rowsAsMaps . add ( row . asJSONDictionary ( ) ) ; } } allDocsResult . put ( "rows" , rowsAsMaps ) ;
public class ParseProcessor { /** * コンスタによるインスタンスを生成する際の前提条件となる引数のチェックを行う 。 * @ throws NullPointerException type or parser is null . */ private static < T > void checkPreconditions ( final Class < T > type , final TextParser < T > parser ) { } }
if ( type == null ) { throw new NullPointerException ( "type is null." ) ; } if ( parser == null ) { throw new NullPointerException ( "parser is null." ) ; }
public class PsGithub { /** * Retrieve Github access token . * @ param home Home of this page * @ param code Github " authorization code " * @ return The token * @ throws IOException If failed */ private String token ( final String home , final String code ) throws IOException { } }
final String uri = new Href ( this . github ) . path ( PsGithub . LOGIN ) . path ( "oauth" ) . path ( PsGithub . ACCESS_TOKEN ) . toString ( ) ; return new JdkRequest ( uri ) . method ( "POST" ) . header ( "Accept" , "application/xml" ) . body ( ) . formParam ( "client_id" , this . app ) . formParam ( "redirect_uri" , home ) . formParam ( "client_secret" , this . key ) . formParam ( PsGithub . CODE , code ) . back ( ) . fetch ( ) . as ( RestResponse . class ) . assertStatus ( HttpURLConnection . HTTP_OK ) . as ( XmlResponse . class ) . assertXPath ( "/OAuth/access_token" ) . xml ( ) . xpath ( "/OAuth/access_token/text()" ) . get ( 0 ) ;
public class GetDeploymentTargetRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetDeploymentTargetRequest getDeploymentTargetRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getDeploymentTargetRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getDeploymentTargetRequest . getDeploymentId ( ) , DEPLOYMENTID_BINDING ) ; protocolMarshaller . marshall ( getDeploymentTargetRequest . getTargetId ( ) , TARGETID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ResultIterator { /** * Appends where claues and prepare for next fetch . Method to be called in * case cql3 enabled . * @ param parsedQuery * parsed query . * @ return cql3 query to be executed . */ private String appendWhereClauseWithScroll ( String parsedQuery ) { } }
String queryWithoutLimit = parsedQuery . replaceAll ( parsedQuery . substring ( parsedQuery . lastIndexOf ( CQLTranslator . LIMIT ) , parsedQuery . length ( ) ) , "" ) ; CQLTranslator translator = new CQLTranslator ( ) ; final String tokenCondition = prepareNext ( translator , queryWithoutLimit ) ; StringBuilder builder = new StringBuilder ( queryWithoutLimit ) ; if ( tokenCondition != null ) { if ( query . getKunderaQuery ( ) . getFilterClauseQueue ( ) . isEmpty ( ) ) { builder . append ( CQLTranslator . ADD_WHERE_CLAUSE ) ; } else { builder . append ( CQLTranslator . AND_CLAUSE ) ; } builder . append ( tokenCondition ) ; } String replaceQuery = replaceAndAppendLimit ( builder . toString ( ) ) ; builder . replace ( 0 , builder . toString ( ) . length ( ) , replaceQuery ) ; translator . buildFilteringClause ( builder ) ; // in case of fetch by ID , token condition will be null and results will // not be empty . return checkOnEmptyResult ( ) && tokenCondition == null ? null : builder . toString ( ) ;
public class CmsJspStandardContextBean { /** * Returns the container page bean for the give resource . < p > * @ param pageResource the resource * @ return the container page bean * @ throws CmsException in case reading the page bean fails */ private CmsContainerPageBean getPage ( CmsResource pageResource ) throws CmsException { } }
CmsContainerPageBean result = null ; if ( ( pageResource != null ) && CmsResourceTypeXmlContainerPage . isContainerPage ( pageResource ) ) { CmsXmlContainerPage xmlContainerPage = CmsXmlContainerPageFactory . unmarshal ( m_cms , pageResource , m_request ) ; result = xmlContainerPage . getContainerPage ( m_cms ) ; CmsModelGroupHelper modelHelper = new CmsModelGroupHelper ( m_cms , OpenCms . getADEManager ( ) . lookupConfiguration ( m_cms , pageResource . getRootPath ( ) ) , CmsJspTagEditable . isEditableRequest ( m_request ) && ( m_request instanceof HttpServletRequest ) ? CmsADESessionCache . getCache ( ( HttpServletRequest ) m_request , m_cms ) : null , CmsContainerpageService . isEditingModelGroups ( m_cms , pageResource ) ) ; result = modelHelper . readModelGroups ( xmlContainerPage . getContainerPage ( m_cms ) ) ; } return result ;
public class CertificateOptionsMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CertificateOptions certificateOptions , ProtocolMarshaller protocolMarshaller ) { } }
if ( certificateOptions == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( certificateOptions . getCertificateTransparencyLoggingPreference ( ) , CERTIFICATETRANSPARENCYLOGGINGPREFERENCE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class BeanUtils { /** * 类型转换 , java系统类型转换为自定义字段说明类型 * @ param field 对应的字段 * @ param descriptor 系统字段说明 * @ param clazz 字段所属的class * @ return 自定义字段说明 */ private static CustomPropertyDescriptor convert ( Field field , PropertyDescriptor descriptor , Class < ? > clazz ) { } }
if ( descriptor == null ) { return null ; } return new CustomPropertyDescriptor ( descriptor . getName ( ) , descriptor . getReadMethod ( ) , descriptor . getWriteMethod ( ) , clazz , field ) ;
public class MobicentsSipServletsEmbeddedImpl { /** * / * ( non - Javadoc ) * @ see org . jboss . arquillian . container . mobicents . servlet . sip . embedded _ 1 . MobicentsSipServletsEmbedded # removeHost ( org . apache . catalina . Host ) */ @ Override public synchronized void removeHost ( Host host ) { } }
if ( log . isDebugEnabled ( ) ) log . debug ( "Removing host[" + host . getName ( ) + "]" ) ; // Is this Host actually among those that are defined ? boolean found = false ; for ( int i = 0 ; i < engines . length ; i ++ ) { Container hosts [ ] = engines [ i ] . findChildren ( ) ; for ( int j = 0 ; j < hosts . length ; j ++ ) { if ( host == ( Host ) hosts [ j ] ) { found = true ; break ; } } if ( found ) break ; } if ( ! found ) return ; // Remove this Host from the associated Engine if ( log . isDebugEnabled ( ) ) log . debug ( " Removing this Host" ) ; host . getParent ( ) . removeChild ( host ) ;
public class CmsSecurityManager { /** * Returns the parameters of a resource in the table of all published template resources . < p > * @ param context the current request context * @ param rfsName the rfs name of the resource * @ return the parameter string of the requested resource * @ throws CmsException if something goes wrong */ public String readStaticExportPublishedResourceParameters ( CmsRequestContext context , String rfsName ) throws CmsException { } }
CmsDbContext dbc = m_dbContextFactory . getDbContext ( context ) ; String result = null ; try { result = m_driverManager . readStaticExportPublishedResourceParameters ( dbc , rfsName ) ; } catch ( Exception e ) { dbc . report ( null , Messages . get ( ) . container ( Messages . ERR_READ_STATEXP_PUBLISHED_RESOURCE_PARAMS_1 , rfsName ) , e ) ; } finally { dbc . clear ( ) ; } return result ;
public class MBeanInfoData { /** * Add an exception to the info map */ private void addException ( ObjectName pName , Exception pExp ) { } }
JSONObject mBeansMap = getOrCreateJSONObject ( infoMap , pName . getDomain ( ) ) ; JSONObject mBeanMap = getOrCreateJSONObject ( mBeansMap , getKeyPropertyString ( pName ) ) ; mBeanMap . put ( DataKeys . ERROR . getKey ( ) , pExp . toString ( ) ) ;
public class CommerceWarehousePersistenceImpl { /** * Returns an ordered range of all the commerce warehouses where groupId = & # 63 ; and commerceCountryId = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result set . Thus , < code > 0 < / code > refers to the first result in the set . Setting both < code > start < / code > and < code > end < / code > to { @ link QueryUtil # ALL _ POS } will return the full result set . If < code > orderByComparator < / code > is specified , then the query will include the given ORDER BY logic . If < code > orderByComparator < / code > is absent and pagination is required ( < code > start < / code > and < code > end < / code > are not { @ link QueryUtil # ALL _ POS } ) , then the query will include the default ORDER BY logic from { @ link CommerceWarehouseModelImpl } . If both < code > orderByComparator < / code > and pagination are absent , for performance reasons , the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order . * @ param groupId the group ID * @ param commerceCountryId the commerce country ID * @ param start the lower bound of the range of commerce warehouses * @ param end the upper bound of the range of commerce warehouses ( not inclusive ) * @ param orderByComparator the comparator to order the results by ( optionally < code > null < / code > ) * @ return the ordered range of matching commerce warehouses */ @ Override public List < CommerceWarehouse > findByG_C ( long groupId , long commerceCountryId , int start , int end , OrderByComparator < CommerceWarehouse > orderByComparator ) { } }
return findByG_C ( groupId , commerceCountryId , start , end , orderByComparator , true ) ;
public class Action { /** * Add an event to the action . * The moment the event will be executed depends on its hook . * @ param k the hook * @ param n the event to attach * @ return { @ code true } iff the event was added */ public boolean addEvent ( Hook k , Event n ) { } }
Set < Event > l = events . get ( k ) ; if ( l == null ) { l = new HashSet < > ( ) ; events . put ( k , l ) ; } return l . add ( n ) ;
public class CellMaskedMatrix { /** * { @ inheritDoc } */ public DoubleVector getRowVector ( int row ) { } }
row = getIndexFromMap ( rowMaskMap , row ) ; DoubleVector v = matrix . getRowVector ( row ) ; return new MaskedDoubleVectorView ( v , colMaskMap ) ;
public class AbstractLogHelper { /** * Resolve a log level reading the value of specified properties . * To compute the applied log level the following rules will be followed : * < ul > the last property with a defined and valid value in the order of the { @ code propertyKeys } argument will be applied < / ul > * < ul > if there is none , { @ link Level # INFO INFO } will be returned < / ul > * @ throws IllegalArgumentException if the value of the specified property is not one of { @ link # ALLOWED _ ROOT _ LOG _ LEVELS } */ static Level resolveLevel ( Props props , String ... propertyKeys ) { } }
Level newLevel = Level . INFO ; for ( String propertyKey : propertyKeys ) { Level level = getPropertyValueAsLevel ( props , propertyKey ) ; if ( level != null ) { newLevel = level ; } } return newLevel ;