signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class BacktrackingSearch { /** * See { @ link # compute ( MealyMachine , Alphabet , Set ) } . Internal version , that uses the { @ link SplitTree } * representation . */ static < S , I , O > Optional < ADSNode < S , I , O > > compute ( final MealyMachine < S , I , ? , O > automaton , final Alphabet < I > input , final SplitTree < S , I , O > node ) { } }
return compute ( automaton , input , node , node . getPartition ( ) . size ( ) ) ;
public class Utils { /** * Get the string resource for the given key . Returns null if not found . */ public static String getResourceString ( Context context , String key ) { } }
int id = getIdentifier ( context , "string" , key ) ; if ( id != 0 ) { return context . getResources ( ) . getString ( id ) ; } else { return null ; }
public class CassandraSchemaManager { /** * On set sub comparator . * @ param cfDef * the cf def * @ param cfProperties * the cf properties * @ param builder * the builder */ private void onSetSubComparator ( CfDef cfDef , Properties cfProperties , StringBuilder builder ) { } }
String subComparatorType = cfProperties . getProperty ( CassandraConstants . SUBCOMPARATOR_TYPE ) ; if ( subComparatorType != null && ColumnFamilyType . valueOf ( cfDef . getColumn_type ( ) ) == ColumnFamilyType . Super ) { if ( builder != null ) { // super column are not supported for composite key as of // now , leaving blank place holder . . } else { cfDef . setSubcomparator_type ( subComparatorType ) ; } }
public class ListStringInputFormat { /** * Creates a reader from an input split * @ param split the split to read * @ return the reader from the given input split */ @ Override public RecordReader createReader ( InputSplit split ) throws IOException , InterruptedException { } }
RecordReader reader = new ListStringRecordReader ( ) ; reader . initialize ( split ) ; return reader ;
public class LIBSVMLoader { /** * Loads a new regression data set from a LIBSVM file , assuming the label is * a numeric target value to predict . * @ param reader the reader for the file to load * @ param sparseRatio the fraction of non zero values to qualify a data * point as sparse * @ param vectorLength the pre - determined length of each vector . If given a * negative value , the largest non - zero index observed in the data will be * used as the length . * @ return a regression data set * @ throws IOException */ public static RegressionDataSet loadR ( Reader reader , double sparseRatio , int vectorLength ) throws IOException { } }
return loadR ( reader , sparseRatio , vectorLength , DataStore . DEFAULT_STORE ) ;
public class SpdySessionStatus { /** * Returns the { @ link SpdySessionStatus } represented by the specified code . * If the specified code is a defined SPDY status code , a cached instance * will be returned . Otherwise , a new instance will be returned . */ public static SpdySessionStatus valueOf ( int code ) { } }
switch ( code ) { case 0 : return OK ; case 1 : return PROTOCOL_ERROR ; case 2 : return INTERNAL_ERROR ; } return new SpdySessionStatus ( code , "UNKNOWN (" + code + ')' ) ;
public class RegistriesInner { /** * Schedules a new run based on the request parameters and add it to the run queue . * @ param resourceGroupName The name of the resource group to which the container registry belongs . * @ param registryName The name of the container registry . * @ param runRequest The parameters of a run that needs to scheduled . * @ 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 RunInner object if successful . */ public RunInner beginScheduleRun ( String resourceGroupName , String registryName , RunRequest runRequest ) { } }
return beginScheduleRunWithServiceResponseAsync ( resourceGroupName , registryName , runRequest ) . toBlocking ( ) . single ( ) . body ( ) ;
public class Java9ConnectionDecoratorFactory { /** * { @ inheritDoc } */ @ Override protected Connection proxyConnection ( Connection target , ConnectionCallback callback ) { } }
return new Java9ConnectionDecorator ( target , callback ) ;
public class Channel { /** * Send Query proposal * @ param queryByChaincodeRequest * @ param peers * @ return responses from peers . * @ throws InvalidArgumentException * @ throws ProposalException */ public Collection < ProposalResponse > queryByChaincode ( QueryByChaincodeRequest queryByChaincodeRequest , Collection < Peer > peers ) throws InvalidArgumentException , ProposalException { } }
return sendProposal ( queryByChaincodeRequest , peers ) ;
public class TimerServiceRamp { /** * Implements { @ link Timers # runAfter ( Runnable , long , TimeUnit ) } */ @ Override public void runEvery ( @ Pin Consumer < ? super Cancel > task , long delay , TimeUnit unit , Result < ? super Cancel > result ) { } }
// cancel ( task ) ; long period = unit . toMillis ( delay ) ; if ( period <= 0 ) { throw new IllegalArgumentException ( ) ; } schedule ( task , new RunEveryScheduler ( period ) , result ) ;
public class HTCashbillServiceImp { /** * ( non - Javadoc ) * @ see com . popbill . api . HTCashbillService # registDeptUser ( java . lang . String , java . lang . String , java . lang . String ) */ public Response registDeptUser ( String CorpNum , String DeptUserID , String DeptUserPWD ) throws PopbillException { } }
if ( CorpNum == null || CorpNum . isEmpty ( ) ) throw new PopbillException ( - 99999999 , "μ—°λ™νšŒμ› μ‚¬μ—…μžλ²ˆν˜Έ(CorpNum)κ°€ μž…λ ₯λ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€." ) ; if ( DeptUserID == null || DeptUserID . isEmpty ( ) ) throw new PopbillException ( - 99999999 , "ν™ˆνƒμŠ€ λΆ€μ„œμ‚¬μš©μž 계정 아이디(DeptUserID)κ°€ μž…λ ₯λ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€." ) ; if ( DeptUserPWD == null || DeptUserPWD . isEmpty ( ) ) throw new PopbillException ( - 99999999 , "ν™ˆνƒμŠ€ λΆ€μ„œμ‚¬μš©μž 계정 λΉ„λ°€λ²ˆν˜Έ(DeptUserPWD)κ°€ μž…λ ₯λ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€." ) ; DeptRequest request = new DeptRequest ( ) ; request . id = DeptUserID ; request . pwd = DeptUserPWD ; String PostData = toJsonString ( request ) ; return httppost ( "/HomeTax/Cashbill/DeptUser" , CorpNum , PostData , null , Response . class ) ;
public class TableSnippets { /** * [ VARIABLE " rowId2 " ] */ public InsertAllResponse insert ( String rowId1 , String rowId2 ) { } }
// [ START ] List < RowToInsert > rows = new ArrayList < > ( ) ; Map < String , Object > row1 = new HashMap < > ( ) ; row1 . put ( "stringField" , "value1" ) ; row1 . put ( "booleanField" , true ) ; Map < String , Object > row2 = new HashMap < > ( ) ; row2 . put ( "stringField" , "value2" ) ; row2 . put ( "booleanField" , false ) ; rows . add ( RowToInsert . of ( rowId1 , row1 ) ) ; rows . add ( RowToInsert . of ( rowId2 , row2 ) ) ; InsertAllResponse response = table . insert ( rows ) ; // do something with response // [ END ] return response ;
public class AliasMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Alias alias , ProtocolMarshaller protocolMarshaller ) { } }
if ( alias == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( alias . getAliasId ( ) , ALIASID_BINDING ) ; protocolMarshaller . marshall ( alias . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( alias . getAliasArn ( ) , ALIASARN_BINDING ) ; protocolMarshaller . marshall ( alias . getDescription ( ) , DESCRIPTION_BINDING ) ; protocolMarshaller . marshall ( alias . getRoutingStrategy ( ) , ROUTINGSTRATEGY_BINDING ) ; protocolMarshaller . marshall ( alias . getCreationTime ( ) , CREATIONTIME_BINDING ) ; protocolMarshaller . marshall ( alias . getLastUpdatedTime ( ) , LASTUPDATEDTIME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class Client { /** * Reads or writes any pending data for this client . Multiple threads should not call this method at the same time . * @ param timeout Wait for up to the specified milliseconds for data to be ready to process . May be zero to return immediately * if there is no data to process . */ public void update ( int timeout ) throws IOException { } }
updateThread = Thread . currentThread ( ) ; synchronized ( updateLock ) { // Blocks to avoid a select while the selector is used to bind the server connection . } long startTime = System . currentTimeMillis ( ) ; int select = 0 ; if ( timeout > 0 ) { select = selector . select ( timeout ) ; } else { select = selector . selectNow ( ) ; } if ( select == 0 ) { emptySelects ++ ; if ( emptySelects == 100 ) { emptySelects = 0 ; // NIO freaks and returns immediately with 0 sometimes , so try to keep from hogging the CPU . long elapsedTime = System . currentTimeMillis ( ) - startTime ; try { if ( elapsedTime < 25 ) Thread . sleep ( 25 - elapsedTime ) ; } catch ( InterruptedException ex ) { } } } else { emptySelects = 0 ; isClosed = false ; Set < SelectionKey > keys = selector . selectedKeys ( ) ; synchronized ( keys ) { for ( Iterator < SelectionKey > iter = keys . iterator ( ) ; iter . hasNext ( ) ; ) { keepAlive ( ) ; SelectionKey selectionKey = iter . next ( ) ; iter . remove ( ) ; try { int ops = selectionKey . readyOps ( ) ; if ( ( ops & SelectionKey . OP_READ ) == SelectionKey . OP_READ ) { if ( selectionKey . attachment ( ) == tcp ) { while ( true ) { Object object = tcp . readObject ( this ) ; if ( object == null ) break ; if ( ! tcpRegistered ) { if ( object instanceof RegisterTCP ) { id = ( ( RegisterTCP ) object ) . connectionID ; synchronized ( tcpRegistrationLock ) { tcpRegistered = true ; tcpRegistrationLock . notifyAll ( ) ; if ( TRACE ) trace ( "kryonet" , this + " received TCP: RegisterTCP" ) ; if ( udp == null ) setConnected ( true ) ; } if ( udp == null ) notifyConnected ( ) ; } continue ; } if ( udp != null && ! udpRegistered ) { if ( object instanceof RegisterUDP ) { synchronized ( udpRegistrationLock ) { udpRegistered = true ; udpRegistrationLock . notifyAll ( ) ; if ( TRACE ) trace ( "kryonet" , this + " received UDP: RegisterUDP" ) ; if ( DEBUG ) { debug ( "kryonet" , "Port " + udp . datagramChannel . socket ( ) . getLocalPort ( ) + "/UDP connected to: " + udp . connectedAddress ) ; } setConnected ( true ) ; } notifyConnected ( ) ; } continue ; } if ( ! isConnected ) continue ; if ( DEBUG ) { String objectString = object == null ? "null" : object . getClass ( ) . getSimpleName ( ) ; if ( ! ( object instanceof FrameworkMessage ) ) { debug ( "kryonet" , this + " received TCP: " + objectString ) ; } else if ( TRACE ) { trace ( "kryonet" , this + " received TCP: " + objectString ) ; } } notifyReceived ( object ) ; } } else { if ( udp . readFromAddress ( ) == null ) continue ; Object object = udp . readObject ( this ) ; if ( object == null ) continue ; if ( DEBUG ) { String objectString = object == null ? "null" : object . getClass ( ) . getSimpleName ( ) ; debug ( "kryonet" , this + " received UDP: " + objectString ) ; } notifyReceived ( object ) ; } } if ( ( ops & SelectionKey . OP_WRITE ) == SelectionKey . OP_WRITE ) tcp . writeOperation ( ) ; } catch ( CancelledKeyException ignored ) { // Connection is closed . } } } } if ( isConnected ) { long time = System . currentTimeMillis ( ) ; if ( tcp . isTimedOut ( time ) ) { if ( DEBUG ) debug ( "kryonet" , this + " timed out." ) ; close ( ) ; } else keepAlive ( ) ; if ( isIdle ( ) ) notifyIdle ( ) ; }
public class DescribeUserRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeUserRequest describeUserRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeUserRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeUserRequest . getUserName ( ) , USERNAME_BINDING ) ; protocolMarshaller . marshall ( describeUserRequest . getAwsAccountId ( ) , AWSACCOUNTID_BINDING ) ; protocolMarshaller . marshall ( describeUserRequest . getNamespace ( ) , NAMESPACE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class DeviceLocal { /** * This method returns object local to target device * @ param deviceId * @ return */ @ Nullable public T get ( int deviceId ) { } }
try { locksMap . get ( deviceId ) . readLock ( ) . lock ( ) ; return backingMap . get ( deviceId ) ; } finally { locksMap . get ( deviceId ) . readLock ( ) . unlock ( ) ; }
public class NullnessPropagationTransfer { /** * We can ' t use ASTHelpers here . It ' s in core , which depends on jdk8 , so we can ' t make jdk8 depend * back on core . */ @ Nullable private static Symbol tryGetSymbol ( Tree tree ) { } }
if ( tree instanceof JCIdent ) { return ( ( JCIdent ) tree ) . sym ; } if ( tree instanceof JCFieldAccess ) { return ( ( JCFieldAccess ) tree ) . sym ; } if ( tree instanceof JCVariableDecl ) { return ( ( JCVariableDecl ) tree ) . sym ; } return null ;
public class MutableBigInteger { /** * Return the index of the lowest set bit in this MutableBigInteger . If the * magnitude of this MutableBigInteger is zero , - 1 is returned . */ private final int getLowestSetBit ( ) { } }
if ( intLen == 0 ) return - 1 ; int j , b ; for ( j = intLen - 1 ; ( j > 0 ) && ( value [ j + offset ] == 0 ) ; j -- ) ; b = value [ j + offset ] ; if ( b == 0 ) return - 1 ; return ( ( intLen - 1 - j ) << 5 ) + Integer . numberOfTrailingZeros ( b ) ;
public class RemoveTagsFromResourceRequest { /** * The tag key or keys to remove . * Specify only the tag key to remove ( not the value ) . To overwrite the value for an existing tag , use * < a > AddTagsToResource < / a > . * @ return The tag key or keys to remove . < / p > * Specify only the tag key to remove ( not the value ) . To overwrite the value for an existing tag , use * < a > AddTagsToResource < / a > . */ public java . util . List < String > getTagKeyList ( ) { } }
if ( tagKeyList == null ) { tagKeyList = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return tagKeyList ;
public class SegmentServiceImpl { /** * metadata for a segment * < pre > < code > * address int48 * length int16 * crc int32 * < / code > < / pre > */ private boolean readMetaSegment ( ReadStream is , int crc ) throws IOException { } }
long value = BitsUtil . readLong ( is ) ; crc = Crc32Caucho . generate ( crc , value ) ; int crcFile = BitsUtil . readInt ( is ) ; if ( crcFile != crc ) { log . fine ( "meta-segment crc mismatch" ) ; return false ; } long address = value & ~ 0xffff ; int length = ( int ) ( ( value & 0xffff ) << 16 ) ; SegmentExtent segment = new SegmentExtent ( _segmentId ++ , address , length ) ; SegmentMeta segmentMeta = findSegmentMeta ( length ) ; segmentMeta . addSegment ( segment ) ; return true ;
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public RenderingIntentReserved createRenderingIntentReservedFromString ( EDataType eDataType , String initialValue ) { } }
RenderingIntentReserved result = RenderingIntentReserved . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
public class LanguageToolHttpHandler { /** * A ( reverse ) proxy can set the ' X - forwarded - for ' header so we can see a user ' s original IP . * But that ' s just a common header than can also be set by the client . So we restrict access to this * server to the load balancer , which should add the header originally with the user ' s own IP . */ @ Nullable private String getRealRemoteAddressOrNull ( HttpExchange httpExchange ) { } }
if ( config . getTrustXForwardForHeader ( ) ) { List < String > forwardedIpsStr = httpExchange . getRequestHeaders ( ) . get ( "X-forwarded-for" ) ; if ( forwardedIpsStr != null && forwardedIpsStr . size ( ) > 0 ) { return forwardedIpsStr . get ( 0 ) ; } } return null ;
public class PhoneNumberUtil { /** * format phone number in E123 format . * @ param pphoneNumberData phone number to format * @ param pcountryData country data * @ return formated phone number as String */ public final String formatE123 ( final PhoneNumberInterface pphoneNumberData , final PhoneCountryData pcountryData ) { } }
if ( pphoneNumberData != null && pcountryData != null && StringUtils . equals ( pcountryData . getCountryCodeData ( ) . getCountryCode ( ) , pphoneNumberData . getCountryCode ( ) ) ) { return this . formatE123National ( pphoneNumberData ) ; } else { return this . formatE123International ( pphoneNumberData ) ; }
public class AsyncLibrary { /** * Find or create the AIO provider . * @ return IAsyncProvider * @ throws AsyncException */ public static synchronized IAsyncProvider createInstance ( ) throws AsyncException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "createInstance" ) ; } if ( instance == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "instance is null. Instantiating new AsyncLibrary " ) ; } instance = new AsyncLibrary ( ) ; } if ( ( aioInitialized == AIO_NOT_INITIALIZED ) || ( aioInitialized == AIO_SHUTDOWN ) ) { initialize ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "createInstance" ) ; } return instance ;
public class ThriftClusterImpl { /** * Get the version from the cluster * @ return * @ throws OperationException */ @ Override public String getVersion ( ) throws ConnectionException { } }
return connectionPool . executeWithFailover ( new AbstractOperationImpl < String > ( tracerFactory . newTracer ( CassandraOperationType . GET_VERSION ) ) { @ Override public String internalExecute ( Client client , ConnectionContext state ) throws Exception { return client . describe_version ( ) ; } } , config . getRetryPolicy ( ) . duplicate ( ) ) . getResult ( ) ;
public class GADImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case AfplibPackage . GAD__GOC_ADAT : setGOCAdat ( ( byte [ ] ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
public class Gold { /** * getter for typeS - gets * @ generated * @ return value of the feature */ public String getTypeS ( ) { } }
if ( Gold_Type . featOkTst && ( ( Gold_Type ) jcasType ) . casFeat_typeS == null ) jcasType . jcas . throwFeatMissing ( "typeS" , "ch.epfl.bbp.uima.types.Gold" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Gold_Type ) jcasType ) . casFeatCode_typeS ) ;
public class SpringIOUtils { /** * Copy the contents of the given input File to the given output File . * @ param in the file to copy from * @ param out the file to copy to * @ return the number of bytes copied * @ throws java . io . IOException in case of I / O errors */ public static int copy ( Resource in , File out ) throws IOException { } }
assert in != null : "No input File specified" ; assert out != null : "No output File specified" ; return copy ( new BufferedInputStream ( in . getInputStream ( ) ) , new BufferedOutputStream ( Files . newOutputStream ( out . toPath ( ) ) ) ) ;
public class CmsFlexController { /** * Returns the combined " last modified " date for all resources read during this request . < p > * @ return the combined " last modified " date for all resources read during this request */ public long getDateLastModified ( ) { } }
int pos = m_flexContextInfoList . size ( ) - 1 ; if ( pos < 0 ) { // ensure a valid position is used return CmsResource . DATE_RELEASED_DEFAULT ; } return ( m_flexContextInfoList . get ( pos ) ) . getDateLastModified ( ) ;
public class Log { /** * Performs all the commands in the . script file . */ private void processScript ( ) { } }
ScriptReaderBase scr = null ; try { if ( database . isFilesInJar ( ) || fa . isStreamElement ( scriptFileName ) ) { scr = ScriptReaderBase . newScriptReader ( database , scriptFileName , scriptFormat ) ; Session session = database . sessionManager . getSysSessionForScript ( database ) ; scr . readAll ( session ) ; scr . close ( ) ; } } catch ( Throwable e ) { if ( scr != null ) { scr . close ( ) ; if ( cache != null ) { cache . close ( false ) ; } closeAllTextCaches ( false ) ; } database . logger . appLog . logContext ( e , null ) ; if ( e instanceof HsqlException ) { throw ( HsqlException ) e ; } else if ( e instanceof IOException ) { throw Error . error ( ErrorCode . FILE_IO_ERROR , e . toString ( ) ) ; } else if ( e instanceof OutOfMemoryError ) { throw Error . error ( ErrorCode . OUT_OF_MEMORY ) ; } else { throw Error . error ( ErrorCode . GENERAL_ERROR , e . toString ( ) ) ; } }
public class CompactionAuditCountVerifier { /** * Obtain a client factory * @ param state job state * @ return a factory which creates { @ link AuditCountClient } . * If no factory is set or an error occurred , a { @ link EmptyAuditCountClientFactory } is * returned which creates a < code > null < / code > { @ link AuditCountClient } */ private static AuditCountClientFactory getClientFactory ( State state ) { } }
if ( ! state . contains ( AuditCountClientFactory . AUDIT_COUNT_CLIENT_FACTORY ) ) { return new EmptyAuditCountClientFactory ( ) ; } try { String factoryName = state . getProp ( AuditCountClientFactory . AUDIT_COUNT_CLIENT_FACTORY ) ; ClassAliasResolver < AuditCountClientFactory > conditionClassAliasResolver = new ClassAliasResolver < > ( AuditCountClientFactory . class ) ; AuditCountClientFactory factory = conditionClassAliasResolver . resolveClass ( factoryName ) . newInstance ( ) ; return factory ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; }
public class BeanUtil { /** * Get map with key / value pairs for properties of a java bean ( using { @ link BeanUtils # describe ( Object ) } ) . * An array of property names can be passed that should be masked with " * * * " because they contain sensitive * information . * @ param beanObject Bean object * @ param maskProperties List of property names * @ return Map with masked key / value pairs */ public static SortedMap < String , Object > getMaskedBeanProperties ( Object beanObject , String [ ] maskProperties ) { } }
try { SortedMap < String , Object > configProperties = new TreeMap < String , Object > ( BeanUtils . describe ( beanObject ) ) ; // always ignore " class " properties which is added by BeanUtils . describe by default configProperties . remove ( "class" ) ; // Mask some properties with confidential information ( if set to any value ) if ( maskProperties != null ) { for ( String propertyName : maskProperties ) { if ( configProperties . containsKey ( propertyName ) && configProperties . get ( propertyName ) != null ) { configProperties . put ( propertyName , "***" ) ; } } } return configProperties ; } catch ( NoSuchMethodException | InvocationTargetException | IllegalAccessException ex ) { throw new IllegalArgumentException ( "Unable to get properties from: " + beanObject , ex ) ; }
public class DSResultIterator { /** * ( non - Javadoc ) * @ see * com . impetus . client . cassandra . query . ResultIterator # populateEntities ( com * . impetus . kundera . metadata . model . EntityMetadata , * com . impetus . kundera . client . Client ) */ @ Override protected List < E > populateEntities ( EntityMetadata m , Client client ) throws Exception { } }
int count = 0 ; List results = new ArrayList ( ) ; MetamodelImpl metaModel = ( MetamodelImpl ) kunderaMetadata . getApplicationMetadata ( ) . getMetamodel ( m . getPersistenceUnit ( ) ) ; EntityType entityType = metaModel . entity ( entityMetadata . getEntityClazz ( ) ) ; Map < String , Object > relationalValues = new HashMap < String , Object > ( ) ; if ( rSet == null ) { String parsedQuery = query . onQueryOverCQL3 ( m , client , metaModel , null ) ; Statement statement = new SimpleStatement ( parsedQuery ) ; statement . setFetchSize ( fetchSize ) ; rSet = ( ( DSClient ) client ) . executeStatement ( statement ) ; rowIter = rSet . iterator ( ) ; } while ( rowIter . hasNext ( ) && count ++ < fetchSize ) { Object entity = null ; Row row = rowIter . next ( ) ; ( ( DSClient ) client ) . populateObjectFromRow ( entityMetadata , metaModel , entityType , results , relationalValues , entity , row ) ; } return results ;
public class Matrix3x2f { /** * Set the elements of this matrix to the ones in < code > m < / code > . * @ param m * the matrix to copy the elements from * @ return this */ public Matrix3x2f set ( Matrix3x2fc m ) { } }
if ( m instanceof Matrix3x2f ) { MemUtil . INSTANCE . copy ( ( Matrix3x2f ) m , this ) ; } else { setMatrix3x2fc ( m ) ; } return this ;
public class InvocationHandlerAdapter { /** * Creates an implementation for any { @ link java . lang . reflect . InvocationHandler } that delegates * all method interceptions to a field with the given name . This field has to be of a subtype of invocation * handler and needs to be set before any invocations are intercepted . Otherwise , a { @ link java . lang . NullPointerException } * will be thrown . * @ param name The name of the field . * @ return An implementation that delegates all method interceptions to an instance field of the given name . */ public static InvocationHandlerAdapter toField ( String name ) { } }
return toField ( name , FieldLocator . ForClassHierarchy . Factory . INSTANCE ) ;
public class CodeGenBase { /** * Translates an IR expression into target language code . * @ param expStatus * The IR status that holds the expressions that we want to code generate . * @ param mergeVisitor * The visitor that translates the IR expression into target language code . * @ return The generated code and data about what has been generated . * @ throws org . overture . codegen . ir . analysis . AnalysisException * If something goes wrong during the code generation process . */ protected Generated genIrExp ( IRStatus < SExpIR > expStatus , MergeVisitor mergeVisitor ) throws org . overture . codegen . ir . analysis . AnalysisException { } }
StringWriter writer = new StringWriter ( ) ; SExpIR expCg = expStatus . getIrNode ( ) ; if ( expStatus . canBeGenerated ( ) ) { mergeVisitor . init ( ) ; expCg . apply ( mergeVisitor , writer ) ; if ( mergeVisitor . hasMergeErrors ( ) ) { return new Generated ( mergeVisitor . getMergeErrors ( ) ) ; } else if ( mergeVisitor . hasUnsupportedTargLangNodes ( ) ) { return new Generated ( new HashSet < VdmNodeInfo > ( ) , mergeVisitor . getUnsupportedInTargLang ( ) ) ; } else { String code = writer . toString ( ) ; return new Generated ( code ) ; } } else { return new Generated ( expStatus . getUnsupportedInIr ( ) , new HashSet < IrNodeInfo > ( ) ) ; }
public class CmsDomUtil { /** * Creates a hidden input field with the given name and value . < p > * @ param name the field name * @ param value the field value * @ return the input element */ private static InputElement createHiddenInput ( String name , String value ) { } }
InputElement input = Document . get ( ) . createHiddenInputElement ( ) ; input . setName ( name ) ; input . setValue ( value ) ; return input ;
public class Timer { /** * Create a new time slot with a given timeout time , and add this new * time slot at the end of the time slot list . * @ param newSlotTimeout * - timeout time for the new slot * @ return time slot that was created and added */ public TimeSlot insertSlotAtEnd ( long newSlotTimeout ) { } }
// this routine assumes that list could be empty TimeSlot retSlot = new TimeSlot ( newSlotTimeout ) ; if ( this . lastSlot == null ) { // list was empty this . lastSlot = retSlot ; this . firstSlot = retSlot ; } else { retSlot . prevEntry = this . lastSlot ; this . lastSlot . nextEntry = retSlot ; this . lastSlot = retSlot ; } return retSlot ;
public class CmsListItemWidget { /** * Removes all registered mouse event handlers including the context menu handler . < p > */ public void removeMouseHandlers ( ) { } }
Iterator < HandlerRegistration > it = m_handlerRegistrations . iterator ( ) ; while ( it . hasNext ( ) ) { it . next ( ) . removeHandler ( ) ; } m_handlerRegistrations . clear ( ) ;
public class KieModuleModelImpl { /** * / * ( non - Javadoc ) * @ see org . kie . kModule . KieProject # removeKieBaseModel ( org . kie . kModule . KieBaseModel ) */ public void moveKBase ( String oldQName , String newQName ) { } }
Map < String , KieBaseModel > newMap = new HashMap < String , KieBaseModel > ( ) ; newMap . putAll ( this . kBases ) ; KieBaseModel kieBaseModel = newMap . remove ( oldQName ) ; newMap . put ( newQName , kieBaseModel ) ; setKBases ( newMap ) ;
public class EnvironmentImage { /** * A list of environment image versions . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setVersions ( java . util . Collection ) } or { @ link # withVersions ( java . util . Collection ) } if you want to override * the existing values . * @ param versions * A list of environment image versions . * @ return Returns a reference to this object so that method calls can be chained together . */ public EnvironmentImage withVersions ( String ... versions ) { } }
if ( this . versions == null ) { setVersions ( new java . util . ArrayList < String > ( versions . length ) ) ; } for ( String ele : versions ) { this . versions . add ( ele ) ; } return this ;
public class DescribeLoadBalancerPoliciesResult { /** * Information about the policies . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setPolicyDescriptions ( java . util . Collection ) } or { @ link # withPolicyDescriptions ( java . util . Collection ) } if * you want to override the existing values . * @ param policyDescriptions * Information about the policies . * @ return Returns a reference to this object so that method calls can be chained together . */ public DescribeLoadBalancerPoliciesResult withPolicyDescriptions ( PolicyDescription ... policyDescriptions ) { } }
if ( this . policyDescriptions == null ) { setPolicyDescriptions ( new com . amazonaws . internal . SdkInternalList < PolicyDescription > ( policyDescriptions . length ) ) ; } for ( PolicyDescription ele : policyDescriptions ) { this . policyDescriptions . add ( ele ) ; } return this ;
public class BackboneGeneration { /** * Computes the negative backbone variables for a given collection of formulas . * @ param formulas the given collection of formulas * @ return the negative backbone or { @ code null } if the formula is UNSAT */ public static Backbone computeNegative ( final Collection < Formula > formulas ) { } }
return compute ( formulas , allVariablesInFormulas ( formulas ) , BackboneType . ONLY_NEGATIVE ) ;
public class FormatUtils { /** * Returns an indexed format by placing the specified index before the given * format . * @ param index * Desired index for the given format * @ param format * Format to be indexed * @ return The format < code > format < / code > indexed with < code > index < / code > */ public static String getIndexedFormat ( int index , String format ) { } }
if ( index < 1 ) throw new IllegalArgumentException ( ) ; if ( format == null ) throw new NullPointerException ( ) ; if ( format . length ( ) == 0 ) throw new IllegalArgumentException ( ) ; return String . format ( INDEXED_FORMAT , index , format ) ;
public class Range { /** * Clamps { @ code value } to this range . * < p > If the value is within this range , it is returned . Otherwise , if it * is { @ code < } than the lower endpoint , the lower endpoint is returned , * else the upper endpoint is returned . Comparisons are performed using the * { @ link Comparable } interface . < / p > * @ param value a non - { @ code null } { @ code T } reference * @ return { @ code value } clamped to this range . */ public T clamp ( T value ) { } }
if ( value == null ) throw new IllegalArgumentException ( "value must not be null" ) ; if ( value . compareTo ( mLower ) < 0 ) { return mLower ; } else if ( value . compareTo ( mUpper ) > 0 ) { return mUpper ; } else { return value ; }
public class IpHelper { /** * Validates a netmask * @ param netmask * String A netmask to test * @ return boolean True if it validates , otherwise false */ public static boolean isValidNetmask ( String netmask ) { } }
try { return isValidNetmask ( InetAddress . getByName ( netmask ) ) ; } catch ( UnknownHostException e ) { return false ; }
public class WorkflowJPA { /** * / * ( non - Javadoc ) * @ see nz . co . senanque . workflow . WorkflowDAO # removeDeferredEvent ( nz . co . senanque . workflow . instances . ProcessInstance , nz . co . senanque . process . instances . TaskBase ) */ @ Transactional public DeferredEvent removeDeferredEvent ( ProcessInstance processInstance , TaskBase task ) { } }
List < DeferredEvent > deferredEvents = processInstance . getDeferredEvents ( ) ; for ( DeferredEvent deferredEvent : deferredEvents ) { if ( deferredEvent . getEventType ( ) != EventType . DONE && deferredEvent . getTaskId ( ) . longValue ( ) == task . getTaskId ( ) && task . getProcessDefinitionName ( ) . equals ( deferredEvent . getProcessDefinitionName ( ) ) ) { log . debug ( "killed deferred event processId {} taskId {} status {} {}" , deferredEvent . getProcessInstance ( ) . getId ( ) , deferredEvent . getId ( ) , deferredEvent . getEventType ( ) , deferredEvent . getComment ( ) ) ; deferredEvent . setEventType ( EventType . DONE ) ; return deferredEvent ; } } log . debug ( "failed to find deferred event processId {} {} taskId {}" , processInstance . getId ( ) , task . getProcessDefinitionName ( ) , task . getTaskId ( ) ) ; return null ;
public class LongRadixHeap { /** * { @ inheritDoc } */ @ Override protected int compare ( Long o1 , Long o2 ) { } }
if ( o1 < o2 ) { return - 1 ; } else if ( o1 > o2 ) { return 1 ; } else { return 0 ; }
public class DObject { /** * Get the DSet with the specified name . */ public final < T extends DSet . Entry > DSet < T > getSet ( String setName ) { } }
@ SuppressWarnings ( "unchecked" ) DSet < T > casted = ( DSet < T > ) getAccessor ( setName ) . get ( this ) ; return casted ;
public class LaTeXListingsGenerator2 { /** * Add a TeX requirement . * @ param requirement the name of the TeX package . */ public void addRequirement ( String requirement ) { } }
if ( ! Strings . isEmpty ( requirement ) ) { if ( this . requirements == null ) { this . requirements = new ArrayList < > ( ) ; } this . requirements . add ( requirement ) ; }
public class ST_Graph { /** * Make a big table of all points in the coords table with an envelope around each point . * We will use this table to remove duplicate points . */ private static void makeEnvelopes ( Statement st , double tolerance , boolean isH2 , int srid ) throws SQLException { } }
st . execute ( "DROP TABLE IF EXISTS" + PTS_TABLE + ";" ) ; if ( tolerance > 0 ) { LOGGER . info ( "Calculating envelopes around coordinates..." ) ; if ( isH2 ) { // Putting all points and their envelopes together . . . st . execute ( "CREATE TABLE " + PTS_TABLE + "( " + "ID SERIAL PRIMARY KEY, " + "THE_GEOM POINT, " + "AREA POLYGON " + ") AS " + "SELECT NULL, START_POINT, START_POINT_EXP FROM " + COORDS_TABLE + " UNION ALL " + "SELECT NULL, END_POINT, END_POINT_EXP FROM " + COORDS_TABLE + ";" ) ; // Putting a spatial index on the envelopes . . . st . execute ( "CREATE SPATIAL INDEX ON " + PTS_TABLE + "(AREA);" ) ; } else { // Putting all points and their envelopes together . . . st . execute ( "CREATE TABLE " + PTS_TABLE + "( ID SERIAL PRIMARY KEY, " + "THE_GEOM GEOMETRY(POINT," + srid + ")," + "AREA GEOMETRY(POLYGON, " + srid + ")" + ") " ) ; st . execute ( "INSERT INTO " + PTS_TABLE + " (SELECT (row_number() over())::int , a.THE_GEOM, A.AREA FROM " + "(SELECT START_POINT AS THE_GEOM, START_POINT_EXP as AREA FROM " + COORDS_TABLE + " UNION ALL " + "SELECT END_POINT AS THE_GEOM, END_POINT_EXP as AREA FROM " + COORDS_TABLE + ") as a);" ) ; // Putting a spatial index on the envelopes . . . st . execute ( "CREATE INDEX ON " + PTS_TABLE + " USING GIST(AREA);" ) ; } } else { LOGGER . info ( "Preparing temporary nodes table from coordinates..." ) ; if ( isH2 ) { // If the tolerance is zero , we just put all points together st . execute ( "CREATE TABLE " + PTS_TABLE + "( " + "ID SERIAL PRIMARY KEY, " + "THE_GEOM POINT" + ") AS " + "SELECT NULL, START_POINT FROM " + COORDS_TABLE + " UNION ALL " + "SELECT NULL, END_POINT FROM " + COORDS_TABLE + ";" ) ; // Putting a spatial index on the points themselves . . . st . execute ( "CREATE SPATIAL INDEX ON " + PTS_TABLE + "(THE_GEOM);" ) ; } else { // If the tolerance is zero , we just put all points together st . execute ( "CREATE TABLE " + PTS_TABLE + "( " + "ID SERIAL PRIMARY KEY, " + "THE_GEOM GEOMETRY(POINT," + srid + ")" + ")" ) ; st . execute ( "INSERT INTO " + PTS_TABLE + " (SELECT (row_number() over())::int , a.the_geom FROM " + "(SELECT START_POINT as THE_GEOM FROM " + COORDS_TABLE + " UNION ALL " + "SELECT END_POINT as THE_GEOM FROM " + COORDS_TABLE + ") as a);" ) ; // Putting a spatial index on the points themselves . . . st . execute ( "CREATE INDEX ON " + PTS_TABLE + " USING GIST(THE_GEOM);" ) ; } }
public class EfficientViewHolder { /** * Get the OnClickListener to call when the user click on the item . * @ param adapterHasListener true if the calling adapter has a global listener on the item . * @ return the click listener to be put into the view . */ public View . OnClickListener getOnClickListener ( boolean adapterHasListener ) { } }
if ( isClickable ( ) && adapterHasListener ) { if ( mViewHolderClickListener == null ) { mViewHolderClickListener = new ViewHolderClickListener < > ( this ) ; } } else { mViewHolderClickListener = null ; } return mViewHolderClickListener ;
public class DomUtils { /** * Adds the attribute to each node in the Document with the given name . * @ param doc * the Document to add attributes to * @ param tagName * the local name of the nodes to add the attribute to * @ param tagNamespaceURI * the namespace uri of the nodes to add the attribute to * @ param attrName * the name of the attribute to add * @ param attrValue * the value of the attribute to add * @ return the original Document with the update attribute nodes */ public static Node addDomAttr ( Document doc , String tagName , String tagNamespaceURI , String attrName , String attrValue ) { } }
// Create a Document to work on Document newDoc = null ; try { System . setProperty ( "javax.xml.parsers.DocumentBuilderFactory" , "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl" ) ; DocumentBuilderFactory dbf = DocumentBuilderFactory . newInstance ( ) ; dbf . setNamespaceAware ( true ) ; DocumentBuilder db = dbf . newDocumentBuilder ( ) ; newDoc = db . newDocument ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; // Fortify Mod : If we got here there is no point going any further return null ; } Transformer identity = null ; try { TransformerFactory TF = TransformerFactory . newInstance ( ) ; // Fortify Mod : disable external entity injection TF . setFeature ( XMLConstants . FEATURE_SECURE_PROCESSING , true ) ; identity = TF . newTransformer ( ) ; // End Fortify Mod identity . transform ( new DOMSource ( doc ) , new DOMResult ( newDoc ) ) ; } catch ( Exception ex ) { System . out . println ( "ERROR: " + ex . getMessage ( ) ) ; } // Get all named nodes in the doucment NodeList namedTags = newDoc . getElementsByTagNameNS ( tagNamespaceURI , tagName ) ; for ( int i = 0 ; i < namedTags . getLength ( ) ; i ++ ) { // Add the attribute to each one Element element = ( Element ) namedTags . item ( i ) ; element . setAttribute ( attrName , attrValue ) ; } // displayNode ( newDoc ) ; return ( Node ) newDoc ;
public class AbstractHttpQuery { /** * Returns the non - empty value of the given required query string parameter . * If this parameter occurs multiple times in the URL , only the last value * is returned and others are silently ignored . * @ param paramname Name of the query string parameter to get . * @ return The value of the parameter . * @ throws BadRequestException if this query string parameter wasn ' t passed * or if its last occurrence had an empty value ( { @ code & amp ; a = } ) . */ public String getRequiredQueryStringParam ( final String paramname ) throws BadRequestException { } }
final String value = getQueryStringParam ( paramname ) ; if ( value == null || value . isEmpty ( ) ) { throw BadRequestException . missingParameter ( paramname ) ; } return value ;
public class BigramExtractor { /** * Returns the score of the contingency table using the specified * significance test * @ param contingencyTable a contingency table specified as four { @ code int } * values * @ param test the significance test to use in evaluating the table */ private double getScore ( int [ ] contingencyTable , SignificanceTest test ) { } }
switch ( test ) { case PMI : return pmi ( contingencyTable ) ; case CHI_SQUARED : return chiSq ( contingencyTable ) ; case LOG_LIKELIHOOD : return logLikelihood ( contingencyTable ) ; default : throw new Error ( test + " not implemented yet" ) ; }
public class CmsOrgUnitsAdminList { /** * Checks if the user has more then one organizational unit to administrate . < p > * @ return true if the user has more then then one organizational unit to administrate * otherwise false * @ throws CmsException if the organizational units can not be read */ public boolean hasMoreAdminOUs ( ) throws CmsException { } }
List < CmsOrganizationalUnit > orgUnits = getOrgUnits ( ) ; if ( orgUnits == null ) { return false ; } if ( orgUnits . size ( ) <= 1 ) { return false ; } return true ;
public class ListOfEDoubleImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public EList < Double > getList ( ) { } }
return ( EList < Double > ) eGet ( Ifc4Package . Literals . LIST_OF_EDOUBLE__LIST , true ) ;
public class ParamValidators { /** * return the relevant Validator by the given class type and required indication */ public static < T extends ParamValidator > T getValidator ( Class < T > clazz , boolean required ) { } }
List < ParamValidator > validators = validatorsMap . get ( clazz ) ; if ( validators != null ) { if ( required ) { return ( T ) validators . get ( 0 ) ; } return ( T ) validators . get ( 1 ) ; } return null ;
public class Repeater { /** * Complete rendering the repeater . * @ return { @ link # EVAL _ PAGE } * @ throws JspException if an error occurs that can not be reported in the page */ public int doEndTag ( ) throws JspException { } }
if ( hasErrors ( ) ) reportErrors ( ) ; else if ( _contentBuffer != null ) write ( _contentBuffer . toString ( ) ) ; return EVAL_PAGE ;
public class FamilyNavigator { /** * Get the family for this child to build the navigator with . * @ param child the child * @ return the family */ private static Family findFamily ( final Child child ) { } }
if ( ! child . isSet ( ) ) { return new Family ( ) ; } final Family foundFamily = ( Family ) child . find ( child . getFromString ( ) ) ; if ( foundFamily == null ) { return new Family ( ) ; } return foundFamily ;
public class IndexUpdateTransactionEventHandler { /** * might be run from a scheduler , so we need to make sure we have a transaction */ private synchronized Map < String , Map < String , Collection < Index < Node > > > > initIndexConfiguration ( ) { } }
Map < String , Map < String , Collection < Index < Node > > > > indexesByLabelAndProperty = new HashMap < > ( ) ; try ( Transaction tx = graphDatabaseService . beginTx ( ) ) { final IndexManager indexManager = graphDatabaseService . index ( ) ; for ( String indexName : indexManager . nodeIndexNames ( ) ) { final Index < Node > index = indexManager . forNodes ( indexName ) ; Map < String , String > indexConfig = indexManager . getConfiguration ( index ) ; if ( Util . toBoolean ( indexConfig . get ( "autoUpdate" ) ) ) { String labels = indexConfig . getOrDefault ( "labels" , "" ) ; for ( String label : labels . split ( ":" ) ) { Map < String , Collection < Index < Node > > > propertyKeyToIndexMap = indexesByLabelAndProperty . computeIfAbsent ( label , s -> new HashMap < > ( ) ) ; String [ ] keysForLabel = indexConfig . getOrDefault ( "keysForLabel:" + label , "" ) . split ( ":" ) ; for ( String property : keysForLabel ) { propertyKeyToIndexMap . computeIfAbsent ( property , s -> new ArrayList < > ( ) ) . add ( index ) ; } } } } tx . success ( ) ; } return indexesByLabelAndProperty ;
public class ManagementClient { /** * Retrieves the runtime information of a subscription in a given topic * @ param topicPath - The path of the topic relative to service bus namespace . * @ param subscriptionName - The name of the subscription * @ return - SubscriptionRuntimeInfo containing the runtime information about the subscription . * @ throws IllegalArgumentException - Thrown if path is null , empty , or not in right format or length . * @ throws TimeoutException - The operation times out . The timeout period is initiated through ClientSettings . operationTimeout * @ throws MessagingEntityNotFoundException - Entity with this name doesn ' t exist . * @ throws AuthorizationFailedException - No sufficient permission to perform this operation . Please check ClientSettings . tokenProvider has correct details . * @ throws ServerBusyException - The server is busy . You should wait before you retry the operation . * @ throws ServiceBusException - An internal error or an unexpected exception occurred . * @ throws InterruptedException if the current thread was interrupted */ public SubscriptionRuntimeInfo getSubscriptionRuntimeInfo ( String topicPath , String subscriptionName ) throws ServiceBusException , InterruptedException { } }
return Utils . completeFuture ( this . asyncClient . getSubscriptionRuntimeInfoAsync ( topicPath , subscriptionName ) ) ;
public class SendGridBuilder { /** * Set password for SendGrid HTTP API . * You can specify a direct value . For example : * < pre > * . password ( " foo " ) ; * < / pre > * You can also specify one or several property keys . For example : * < pre > * . password ( " $ { custom . property . high - priority } " , " $ { custom . property . low - priority } " ) ; * < / pre > * The properties are not immediately evaluated . The evaluation will be done * when the { @ link # build ( ) } method is called . * If you provide several property keys , evaluation will be done on the * first key and if the property exists ( see { @ link EnvironmentBuilder } ) , * its value is used . If the first property doesn ' t exist in properties , * then it tries with the second one and so on . * @ param password * one value , or one or several property keys * @ return this instance for fluent chaining */ public SendGridBuilder password ( String ... password ) { } }
for ( String p : password ) { if ( p != null ) { passwords . add ( p ) ; } } return this ;
public class Matrix4f { /** * Set the upper left 3x3 submatrix of this { @ link Matrix4f } to that of the given { @ link Matrix4f } * and don ' t change the other elements . * @ param mat * the { @ link Matrix4f } * @ return this */ public Matrix4f set3x3 ( Matrix4f mat ) { } }
MemUtil . INSTANCE . copy3x3 ( mat , this ) ; properties &= mat . properties & ~ ( PROPERTY_PERSPECTIVE ) ; return this ;
public class ArchivalUrlCSSReplayRenderer { /** * / * ( non - Javadoc ) * @ see org . archive . wayback . replay . HTMLReplayRenderer # updatePage ( org . archive . wayback . replay . HTMLPage , javax . servlet . http . HttpServletRequest , javax . servlet . http . HttpServletResponse , org . archive . wayback . core . WaybackRequest , org . archive . wayback . core . CaptureSearchResult , org . archive . wayback . core . Resource , org . archive . wayback . ResultURIConverter , org . archive . wayback . core . CaptureSearchResults ) */ @ Override protected void updatePage ( TextDocument page , HttpServletRequest httpRequest , HttpServletResponse httpResponse , WaybackRequest wbRequest , CaptureSearchResult result , Resource resource , ResultURIConverter uriConverter , CaptureSearchResults results ) throws ServletException , IOException { } }
page . resolveCSSUrls ( ) ; // if any CSS - specific jsp inserts are configured , run and insert . . . // Switch to end of document , resolving issue with @ import CSS syntax which must be at the start of the file . // See # 91 ( https : / / github . com / iipc / openwayback / pull / 91) page . insertAtEndOfDocument ( buildInsertText ( page , httpRequest , httpResponse , wbRequest , results , result , resource ) ) ;
public class MultipleAlignmentJmol { /** * Colors every Block of the structures with a different color , following * the palette . It colors each Block differently , no matter if it is from * the same or different BlockSet . */ public static String getMultiBlockJmolString ( MultipleAlignment multAln , List < Atom [ ] > transformedAtoms , ColorBrewer colorPalette , boolean colorByBlocks ) { } }
StringWriter jmol = new StringWriter ( ) ; jmol . append ( DEFAULT_SCRIPT ) ; jmol . append ( "select *; color lightgrey; backbone 0.1; " ) ; int blockNum = multAln . getBlocks ( ) . size ( ) ; Color [ ] colors = colorPalette . getColorPalette ( blockNum ) ; // For every structure color all the blocks with the printBlock method for ( int str = 0 ; str < transformedAtoms . size ( ) ; str ++ ) { jmol . append ( "select */" + ( str + 1 ) + "; color lightgrey; model " + ( str + 1 ) + "; " ) ; int index = 0 ; for ( BlockSet bs : multAln . getBlockSets ( ) ) { for ( Block b : bs . getBlocks ( ) ) { List < List < Integer > > alignRes = b . getAlignRes ( ) ; printJmolScript4Block ( transformedAtoms . get ( str ) , alignRes , colors [ index ] , jmol , str , index , blockNum ) ; index ++ ; } } } jmol . append ( "model 0; " ) ; jmol . append ( LIGAND_DISPLAY_SCRIPT ) ; return jmol . toString ( ) ;
public class CorporationApi { /** * Get corporation starbases ( POSes ) Returns list of corporation starbases * ( POSes ) - - - This route is cached for up to 3600 seconds - - - Requires one * of the following EVE corporation role ( s ) : Director SSO Scope : * esi - corporations . read _ starbases . v1 * @ param corporationId * An EVE corporation ID ( required ) * @ param datasource * The server name you would like data from ( optional , default to * tranquility ) * @ param ifNoneMatch * ETag from a previous request . A 304 will be returned if this * matches the current ETag ( optional ) * @ param page * Which page of results to return ( optional , default to 1) * @ param token * Access token to use if unable to set a header ( optional ) * @ return ApiResponse & lt ; List & lt ; CorporationStarbasesResponse & gt ; & gt ; * @ throws ApiException * If fail to call the API , e . g . server error or cannot * deserialize the response body */ public ApiResponse < List < CorporationStarbasesResponse > > getCorporationsCorporationIdStarbasesWithHttpInfo ( Integer corporationId , String datasource , String ifNoneMatch , Integer page , String token ) throws ApiException { } }
com . squareup . okhttp . Call call = getCorporationsCorporationIdStarbasesValidateBeforeCall ( corporationId , datasource , ifNoneMatch , page , token , null ) ; Type localVarReturnType = new TypeToken < List < CorporationStarbasesResponse > > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class NamedResolverMap { /** * Create a GroupName from this NamedResolverMap . * @ param prefixPath Additional path elements to put in front of the * returned path . * @ param extraTags Additional tags to put in the tag set . The extraTags * argument will override any values present in the NamedResolverMap . * @ return A group name derived from this NamedResolverMap and the supplied * arguments . */ public GroupName getGroupName ( @ NonNull List < String > prefixPath , @ NonNull Map < String , MetricValue > extraTags ) { } }
final Stream < String > suffixPath = data . entrySet ( ) . stream ( ) . filter ( entry -> entry . getKey ( ) . getLeft ( ) . isPresent ( ) ) // Only retain int keys . . sorted ( Comparator . comparing ( entry -> entry . getKey ( ) . getLeft ( ) . get ( ) ) ) // Sort by int key . . map ( Map . Entry :: getValue ) . map ( value -> value . mapCombine ( b -> b . toString ( ) , i -> i . toString ( ) , Function . identity ( ) ) ) ; final SimpleGroupPath path = SimpleGroupPath . valueOf ( Stream . concat ( prefixPath . stream ( ) , suffixPath ) . collect ( Collectors . toList ( ) ) ) ; final Map < String , MetricValue > tags = data . entrySet ( ) . stream ( ) . filter ( entry -> entry . getKey ( ) . getRight ( ) . isPresent ( ) ) // Only retain string keys . . collect ( Collectors . toMap ( entry -> entry . getKey ( ) . getRight ( ) . get ( ) , entry -> entry . getValue ( ) . mapCombine ( MetricValue :: fromBoolean , MetricValue :: fromIntValue , MetricValue :: fromStrValue ) ) ) ; tags . putAll ( extraTags ) ; return GroupName . valueOf ( path , tags ) ;
public class RefreshEvent { /** * refresh metric settings of topologies and sync metric meta from local cache */ @ SuppressWarnings ( "unchecked" ) private void doRefreshTopologies ( ) { } }
for ( String topology : JStormMetrics . SYS_TOPOLOGIES ) { if ( ! context . getTopologyMetricContexts ( ) . containsKey ( topology ) ) { LOG . info ( "adding {} to metric context." , topology ) ; Map conf = new HashMap ( ) ; if ( topology . equals ( JStormMetrics . CLUSTER_METRIC_KEY ) ) { // there ' s no need to consider sample rate when cluster metrics merge conf . put ( ConfigExtension . TOPOLOGY_METRIC_SAMPLE_RATE , 1.0 ) ; } Set < ResourceWorkerSlot > workerSlot = Sets . newHashSet ( new ResourceWorkerSlot ( ) ) ; TopologyMetricContext metricContext = new TopologyMetricContext ( topology , workerSlot , conf ) ; context . getTopologyMetricContexts ( ) . putIfAbsent ( topology , metricContext ) ; syncMetaFromCache ( topology , context . getTopologyMetricContexts ( ) . get ( topology ) ) ; } // in the first 10 min , sync every 1 min if ( context . getNimbusData ( ) . uptime ( ) < INIT_SYNC_REMOTE_META_TIME_SEC ) { syncMetaFromRemote ( topology , context . getTopologyMetricContexts ( ) . get ( topology ) , Lists . newArrayList ( MetaType . TOPOLOGY , MetaType . WORKER , MetaType . NIMBUS ) ) ; } else { // after that , sync every 5 min checkTimeAndSyncMetaFromRemote ( topology , context . getTopologyMetricContexts ( ) . get ( topology ) , Lists . newArrayList ( MetaType . values ( ) ) ) ; } } Map < String , Assignment > assignMap ; try { assignMap = Cluster . get_all_assignment ( context . getStormClusterState ( ) , null ) ; for ( Entry < String , Assignment > entry : assignMap . entrySet ( ) ) { String topology = entry . getKey ( ) ; Assignment assignment = entry . getValue ( ) ; TopologyMetricContext metricContext = context . getTopologyMetricContexts ( ) . get ( topology ) ; if ( metricContext == null ) { metricContext = new TopologyMetricContext ( assignment . getWorkers ( ) ) ; metricContext . setTaskNum ( NimbusUtils . getTopologyTaskNum ( assignment ) ) ; syncMetaFromCache ( topology , metricContext ) ; LOG . info ( "adding {} to metric context." , topology ) ; context . getTopologyMetricContexts ( ) . put ( topology , metricContext ) ; } else { boolean modify = false ; if ( metricContext . getTaskNum ( ) != NimbusUtils . getTopologyTaskNum ( assignment ) ) { modify = true ; metricContext . setTaskNum ( NimbusUtils . getTopologyTaskNum ( assignment ) ) ; } if ( ! assignment . getWorkers ( ) . equals ( metricContext . getWorkerSet ( ) ) ) { modify = true ; metricContext . setWorkerSet ( assignment . getWorkers ( ) ) ; } // for normal topologies , only sync topology / component level metrics checkTimeAndSyncMetaFromRemote ( topology , metricContext , Lists . newArrayList ( MetaType . TOPOLOGY , MetaType . COMPONENT ) ) ; // we may need to sync meta when task num / workers change metricContext . setSyncMeta ( ! modify ) ; } } } catch ( Exception e1 ) { LOG . warn ( "Failed to get assignments" ) ; return ; } List < String > removing = new ArrayList < > ( ) ; for ( String topology : context . getTopologyMetricContexts ( ) . keySet ( ) ) { if ( ! JStormMetrics . SYS_TOPOLOGY_SET . contains ( topology ) && ! assignMap . containsKey ( topology ) ) { removing . add ( topology ) ; } } for ( String topology : removing ) { LOG . info ( "removing topology:{}" , topology ) ; RemoveTopologyEvent . pushEvent ( topology ) ; syncRemoteTimes . remove ( topology ) ; }
public class AreaPositions { /** * Merge this Positions with another one . If the given { @ link Positions } is : * - SinglePosition , it will raise an IllegalArgumentException . * - LinearPositions , it will return a new AreaPosition by appending the given LinearPositions to this . * - AreaPositions , it will return a new MultiDimensionalPositions composed by this and the given AreaPositions , * in order . * - Any other , it delegates to the other the merge logic . * @ param other Positions instance to merge with . * @ return Positions results of merging . */ @ Override public Positions merge ( Positions other ) { } }
if ( other instanceof SinglePosition ) { throw new IllegalArgumentException ( "Cannot merge single position and area children" ) ; } else if ( other instanceof LinearPositions ) { LinearPositions that = ( LinearPositions ) other ; return builder ( ) . addLinearPosition ( that ) . build ( ) ; } else if ( other instanceof AreaPositions ) { AreaPositions that = ( AreaPositions ) other ; return MultiDimensionalPositions . builder ( ) . addAreaPosition ( this ) . addAreaPosition ( that ) . build ( ) ; } else { return other . merge ( this ) ; }
public class MetaModel { /** * TODO AY : add prepared association ' s lists by type */ protected List < OneToManyAssociation > getOneToManyAssociations ( List < Association > exclusions ) { } }
List < OneToManyAssociation > one2Manies = new ArrayList < > ( ) ; for ( Association association : associations ) { if ( association . getClass ( ) . equals ( OneToManyAssociation . class ) && ! exclusions . contains ( association ) ) { one2Manies . add ( ( OneToManyAssociation ) association ) ; } } return one2Manies ;
public class Val { /** * As class . * @ param < T > the type parameter * @ param defaultValue the default value * @ return The object as a class */ @ SuppressWarnings ( "unchecked" ) public < T > Class < T > asClass ( Class < T > defaultValue ) { } }
return as ( Class . class , defaultValue ) ;
public class HadoopUtil { /** * Extracts from the configuration all properties having the same base a Map of Key / value pair . Example : base : " hadoopoffice . read . filter . metadata . " , properties in JobConf " hadoopoffice . read . filter . metadata . author " = " Martha Musterfrau " , " hadoopoffice . read . filter . metadata . keywords " = " test , document " , " hadoopoffice . test " = " test " will return a Map with the following elements : * " metadata . author " = " Martha Musterfrau " , " metadata . keywords " = " test , document " * @ param conf Configuration of application * @ param base look for all keys with this base * @ return Map with key / values of all keys having the specified base . Note the base is removed from the key */ public static Map < String , String > parsePropertiesFromBase ( Configuration conf , String base ) { } }
HashMap < String , String > result = new HashMap < > ( ) ; for ( Map . Entry < String , String > currentItem : conf ) { String currentKey = currentItem . getKey ( ) ; if ( currentKey . startsWith ( base ) ) { String strippedKey = currentKey . substring ( base . length ( ) ) ; result . put ( strippedKey , currentItem . getValue ( ) ) ; } } return result ;
public class AbstractBitcoinFlinkInputFormat { /** * Reads data supplied by Flink with @ see org . zuinnote . hadoop . bitcoin . format . common . BitcoinBlockReader * ( non - Javadoc ) * @ see org . apache . flink . api . common . io . FileInputFormat # open ( org . apache . flink . core . fs . FileInputSplit ) */ @ Override public void open ( FileInputSplit split ) throws IOException { } }
super . open ( split ) ; LOG . debug ( "Initialize Bitcoin reader" ) ; // temporary measure to set buffer size to 1 , otherwise we cannot guarantee that checkpointing works bbr = new BitcoinBlockReader ( this . stream , this . maxSizeBitcoinBlock , 1 , this . specificMagicArray , this . useDirectBuffer , this . readAuxPOW ) ;
public class MIDDCombiner { /** * Combine two MIDD with same level of attribute at their roots * @ param n1 * @ param n2 * @ return */ @ SuppressWarnings ( { } }
"unchecked" , "rawtypes" } ) private InternalNode < ? > combineIDDSameLevel ( InternalNode n1 , InternalNode n2 ) throws MIDDException { if ( n1 . getID ( ) != n2 . getID ( ) ) { throw new IllegalArgumentException ( "Both params should have the same variable level at their root" ) ; } if ( n1 . getType ( ) != n2 . getType ( ) ) { throw new IllegalArgumentException ( "Both IDD roots should have the same data type" ) ; } Partition p1 = PartitionBuilder . createPartition ( n1 . getIntervals ( ) ) ; Partition p2 = PartitionBuilder . createPartition ( n2 . getIntervals ( ) ) ; Partition < ? > p = PartitionBuilder . union ( p1 , p2 ) ; if ( p . size ( ) == 0 ) { log . error ( "Empty unioned partition" ) ; return null ; } InternalNodeState newState = combineIndeterminateStates ( n1 . getState ( ) , n2 . getState ( ) ) ; InternalNode < ? > n = NodeUtils . createInternalNode ( n1 . getID ( ) , newState , n1 . getType ( ) ) ; for ( Interval < ? > interval : p . getIntervals ( ) ) { AbstractNode op1 = n1 . getChild ( interval ) ; AbstractNode op2 = n2 . getChild ( interval ) ; AbstractNode child = null ; if ( op1 != null && op2 != null ) { child = combine ( op1 , op2 ) ; } else if ( op1 != null || op2 != null ) { child = GenericUtils . newInstance ( op1 == null ? op2 : op1 ) ; } else { throw new RuntimeException ( "Error merging two partitions, " + "the output partition has an item not belong to both previous ones" ) ; } if ( child != null ) { AbstractEdge < ? > edge = EdgeUtils . createEdge ( interval , n . getType ( ) ) ; if ( edge . getIntervals ( ) . size ( ) == 0 ) { throw new RuntimeException ( "Empty edge" ) ; } n . addChild ( edge , child ) ; } } return n ;
public class FastFourierTransform { /** * This is the Gold rader bit - reversal algorithm */ public static void bitreverse ( DoubleVector data , int i0 , int stride ) { } }
int n = data . length ( ) ; for ( int i = 0 , j = 0 ; i < n - 1 ; i ++ ) { int k = n / 2 ; if ( i < j ) { double tmp = data . get ( i0 + stride * i ) ; data . set ( i0 + stride * i , data . get ( i0 + stride * j ) ) ; data . set ( i0 + stride * j , tmp ) ; } while ( k <= j ) { j = j - k ; k = k / 2 ; } j += k ; }
public class ExcelDataProvider { /** * { @ inheritDoc } */ @ Override public String [ ] readLine ( int line , boolean readResult ) throws TechnicalException { } }
final Sheet sheet = workbook . getSheetAt ( 0 ) ; final Row row = sheet . getRow ( line ) ; if ( row == null || "" . equals ( readCell ( row . getCell ( 0 ) ) ) ) { return null ; } else { final String [ ] ret = readResult ? new String [ columns . size ( ) ] : new String [ columns . size ( ) - 1 ] ; Cell cell ; for ( int i = 0 ; i < ret . length ; i ++ ) { if ( ( cell = row . getCell ( i ) ) == null ) { ret [ i ] = "" ; } else { ret [ i ] = readCell ( cell ) ; } } return ret ; }
public class Facet { /** * Creates a { @ link RequestDispatcher } that handles the given view , or * return null if no such view was found . * @ param type * If " it " is non - null , { @ code it . getClass ( ) } . Otherwise the class * from which the view is searched . */ public RequestDispatcher createRequestDispatcher ( RequestImpl request , Klass < ? > type , Object it , String viewName ) throws IOException { } }
return null ; // should be really abstract , but not
public class Log { /** * Send an ERROR log message with specified subsystem . If subsystem is not enabled the message * will not be logged * @ param subsystem logging subsystem * @ param tag Used to identify the source of a log message . It usually identifies the class or * activity where the log call occurs . * @ param msg The message you would like logged . * @ return */ public static int e ( ISubsystem subsystem , String tag , String msg ) { } }
return isEnabled ( subsystem ) ? currentLog . e ( tag , getMsg ( subsystem , msg ) ) : 0 ;
public class InstrumentedDataWriterBase { /** * Build a { @ link ScheduledThreadPoolExecutor } that updates record - level and byte - level metrics . */ private static ScheduledThreadPoolExecutor buildWriterMetricsUpdater ( ) { } }
return new ScheduledThreadPoolExecutor ( 1 , ExecutorsUtils . newThreadFactory ( Optional . of ( log ) , Optional . of ( "WriterMetricsUpdater-%d" ) ) ) ;
public class ExceptionUtils { /** * < p > Returns an array where each element is a line from the argument . < / p > * < p > The end of line is determined by the value of { @ link System # lineSeparator ( ) } . < / p > * @ param stackTrace a stack trace String * @ return an array where each element is a line from the argument */ @ GwtIncompatible ( "incompatible method" ) static String [ ] getStackFrames ( final String stackTrace ) { } }
final String linebreak = System . lineSeparator ( ) ; final StringTokenizer frames = new StringTokenizer ( stackTrace , linebreak ) ; final List < String > list = new ArrayList < > ( ) ; while ( frames . hasMoreTokens ( ) ) { list . add ( frames . nextToken ( ) ) ; } return list . toArray ( new String [ list . size ( ) ] ) ;
public class JSTypeRegistry { /** * Given a node , get a human - readable name for the type of that node so * that will be easy for the programmer to find the original declaration . * For example , if SubFoo ' s property " bar " might have the human - readable * name " Foo . prototype . bar " . * @ param n The node . * @ param dereference If true , the type of the node will be dereferenced * to an Object type , if possible . */ @ VisibleForTesting String getReadableJSTypeName ( Node n , boolean dereference ) { } }
JSType type = getJSTypeOrUnknown ( n ) ; if ( dereference ) { JSType autoboxed = type . autobox ( ) ; if ( ! autoboxed . isNoType ( ) ) { type = autoboxed ; } } String name = getSimpleReadableJSTypeName ( type ) ; if ( name != null ) { return name ; } // If we ' re analyzing a GETPROP , the property may be inherited by the // prototype chain . So climb the prototype chain and find out where // the property was originally defined . if ( n . isGetProp ( ) ) { ObjectType objectType = getJSTypeOrUnknown ( n . getFirstChild ( ) ) . dereference ( ) ; if ( objectType != null ) { String propName = n . getLastChild ( ) . getString ( ) ; if ( objectType . getConstructor ( ) != null && objectType . getConstructor ( ) . isInterface ( ) ) { objectType = objectType . getTopDefiningInterface ( propName ) ; } else { // classes while ( objectType != null && ! objectType . hasOwnProperty ( propName ) ) { objectType = objectType . getImplicitPrototype ( ) ; } } // Don ' t show complex function names or anonymous types . // Instead , try to get a human - readable type name . if ( objectType != null && ( objectType . getConstructor ( ) != null || objectType . isFunctionPrototypeType ( ) ) ) { return objectType + "." + propName ; } } } if ( n . isQualifiedName ( ) ) { return n . getQualifiedName ( ) ; } else if ( type . isFunctionType ( ) ) { // Don ' t show complex function names . return "function" ; } else { return type . toString ( ) ; }
public class User { /** * Generates a new password reset token . Sent via email for pass reset . * @ return the pass reset token */ public final String generatePasswordResetToken ( ) { } }
if ( StringUtils . isBlank ( identifier ) ) { return "" ; } Sysprop s = CoreUtils . getInstance ( ) . getDao ( ) . read ( getAppid ( ) , identifier ) ; if ( s != null ) { String token = Utils . generateSecurityToken ( 42 , true ) ; s . addProperty ( Config . _RESET_TOKEN , token ) ; CoreUtils . getInstance ( ) . getDao ( ) . update ( getAppid ( ) , s ) ; return token ; } return "" ;
public class Visibility { /** * The default implementation of this method calls * { @ link # onAppear ( ViewGroup , View , TransitionValues , TransitionValues ) } . * Subclasses should override this method or * { @ link # onAppear ( ViewGroup , View , TransitionValues , TransitionValues ) } . * if they need to create an Animator when targets appear . * The method should only be called by the Visibility class ; it is * not intended to be called from external classes . * @ param sceneRoot The root of the transition hierarchy * @ param startValues The target values in the start scene * @ param startVisibility The target visibility in the start scene * @ param endValues The target values in the end scene * @ param endVisibility The target visibility in the end scene * @ return An Animator to be started at the appropriate time in the * overall transition for this scene change . A null value means no animation * should be run . */ @ Nullable public Animator onAppear ( @ NonNull ViewGroup sceneRoot , @ Nullable TransitionValues startValues , int startVisibility , @ Nullable TransitionValues endValues , int endVisibility ) { } }
if ( ( mMode & MODE_IN ) != MODE_IN || endValues == null ) { return null ; } if ( startValues == null ) { VisibilityInfo parentVisibilityInfo = null ; View endParent = ( View ) endValues . view . getParent ( ) ; TransitionValues startParentValues = getMatchedTransitionValues ( endParent , false ) ; TransitionValues endParentValues = getTransitionValues ( endParent , false ) ; parentVisibilityInfo = getVisibilityChangeInfo ( startParentValues , endParentValues ) ; if ( parentVisibilityInfo . visibilityChange ) { return null ; } } final boolean isForcedVisibility = mForcedStartVisibility != - 1 || mForcedEndVisibility != - 1 ; if ( isForcedVisibility ) { // Make sure that we reverse the effect of onDisappear ' s setTransitionAlpha ( 0) Object savedAlpha = endValues . view . getTag ( R . id . transitionAlpha ) ; if ( savedAlpha instanceof Float ) { endValues . view . setAlpha ( ( Float ) savedAlpha ) ; endValues . view . setTag ( R . id . transitionAlpha , null ) ; } } return onAppear ( sceneRoot , endValues . view , startValues , endValues ) ;
public class PersistenceController { /** * Wraps loading all conversations from store implementation into an Observable . * @ return Observable returning all conversations from store . */ Observable < List < ChatConversationBase > > loadAllConversations ( ) { } }
return Observable . create ( emitter -> storeFactory . execute ( new StoreTransaction < ChatStore > ( ) { @ Override protected void execute ( ChatStore store ) { store . open ( ) ; List < ChatConversationBase > conversations = store . getAllConversations ( ) ; store . close ( ) ; emitter . onNext ( conversations ) ; emitter . onCompleted ( ) ; } } ) , Emitter . BackpressureMode . LATEST ) ;
public class FactorGraph { /** * Get all of the variables that the two factors have in common . */ public Set < Integer > getSharedVariables ( int factor1 , int factor2 ) { } }
Set < Integer > varNums = new HashSet < Integer > ( factorVariableMap . get ( factor1 ) ) ; varNums . retainAll ( factorVariableMap . get ( factor2 ) ) ; return varNums ;
public class CmsAvailability { /** * Creates an input field for the notification interval . < p > * @ return HTML code for the notification interval input field . */ public String buildInputNotificationInterval ( ) { } }
String propVal = null ; if ( ! isMultiOperation ( ) ) { try { propVal = getCms ( ) . readPropertyObject ( getParamResource ( ) , CmsPropertyDefinition . PROPERTY_NOTIFICATION_INTERVAL , false ) . getValue ( ) ; } catch ( CmsException e ) { if ( LOG . isInfoEnabled ( ) ) { LOG . info ( e . getLocalizedMessage ( ) ) ; } } } if ( CmsStringUtil . isEmpty ( propVal ) ) { propVal = "" ; } StringBuffer result = new StringBuffer ( ) ; result . append ( "<input class=\"maxwidth\" type=\"text\" name=\"" ) ; result . append ( CmsAvailability . PARAM_NOTIFICATION_INTERVAL ) ; result . append ( "\" value=\"" ) ; result . append ( propVal ) ; result . append ( "\">" ) ; return result . toString ( ) ;
public class ProofObligation { /** * Create the context ( forall x , y , z . . . ) for a Proof Obligation for * eq and ord relations . */ protected AForAllExp makeRelContext ( ATypeDefinition node , AVariableExp ... exps ) { } }
AForAllExp forall_exp = new AForAllExp ( ) ; forall_exp . setType ( new ABooleanBasicType ( ) ) ; ATypeMultipleBind tmb = new ATypeMultipleBind ( ) ; List < PPattern > pats = new LinkedList < > ( ) ; for ( AVariableExp exp : exps ) { pats . add ( AstFactory . newAIdentifierPattern ( exp . getName ( ) . clone ( ) ) ) ; } tmb . setPlist ( pats ) ; tmb . setType ( node . getType ( ) . clone ( ) ) ; List < PMultipleBind > binds = new LinkedList < > ( ) ; binds . add ( tmb ) ; forall_exp . setBindList ( binds ) ; return forall_exp ;
public class ConfluentRegistryAvroDeserializationSchema { /** * Creates { @ link AvroDeserializationSchema } that produces classes that were generated from avro * schema and looks up writer schema in Confluent Schema Registry . * @ param tClass class of record to be produced * @ param url url of schema registry to connect * @ return deserialized record */ public static < T extends SpecificRecord > ConfluentRegistryAvroDeserializationSchema < T > forSpecific ( Class < T > tClass , String url ) { } }
return forSpecific ( tClass , url , DEFAULT_IDENTITY_MAP_CAPACITY ) ;
public class XTraceBufferedImpl { /** * ( non - Javadoc ) * @ see java . util . List # lastIndexOf ( java . lang . Object ) */ public int lastIndexOf ( Object o ) { } }
int index = - 1 ; try { for ( int i = 0 ; i < events . size ( ) ; i ++ ) { if ( events . get ( i ) . equals ( o ) ) { index = i ; } } } catch ( IOException e ) { e . printStackTrace ( ) ; } return index ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcMechanicalSteelMaterialProperties ( ) { } }
if ( ifcMechanicalSteelMaterialPropertiesEClass == null ) { ifcMechanicalSteelMaterialPropertiesEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 319 ) ; } return ifcMechanicalSteelMaterialPropertiesEClass ;
public class CatalogContext { /** * Given a class name in the catalog jar , loads it from the jar , even if the * jar is served from an URL and isn ' t in the classpath . * @ param procedureClassName The name of the class to load . * @ return A java Class variable associated with the class . * @ throws ClassNotFoundException if the class is not in the jar file . */ public Class < ? > classForProcedureOrUDF ( String procedureClassName ) throws LinkageError , ExceptionInInitializerError , ClassNotFoundException { } }
return classForProcedureOrUDF ( procedureClassName , m_catalogInfo . m_jarfile . getLoader ( ) ) ;
public class QuickConstructorGenerator { /** * Returns a factory instance for one type of object . Each method in the * interface defines a constructor via its parameters . Any checked * exceptions declared thrown by the constructor must also be declared by * the method . The method return types can be the same type as the * constructed object or a supertype . * < p > Here is a contrived example for constructing strings . In practice , * such a string factory is is useless , since the " new " operator can be * invoked directly . * < pre > * public interface StringFactory { * String newEmptyString ( ) ; * String newStringFromChars ( char [ ] chars ) ; * String newStringFromBytes ( byte [ ] bytes , String charsetName ) * throws UnsupportedEncodingException ; * < / pre > * Here ' s an example of it being used : * < pre > * StringFactory sf = QuickConstructorGenerator . getInstance ( String . class , StringFactory . class ) ; * String str = sf . newStringFromChars ( new char [ ] { ' h ' , ' e ' , ' l ' , ' l ' , ' o ' } ) ; * < / pre > * @ param objectType type of object to construct * @ param factory interface defining which objects can be constructed * @ throws IllegalArgumentException if factory type is not an interface or * if it is malformed */ @ SuppressWarnings ( "unchecked" ) public static synchronized < F > F getInstance ( Class < ? > objectType , Class < F > factory ) { } }
try { return org . cojen . util . QuickConstructorGenerator . getInstance ( objectType , factory ) ; } catch ( NoClassDefFoundError e ) { // Use older code instead . } SoftValuedCache < Class < ? > , Object > innerCache = cCache . get ( factory ) ; if ( innerCache == null ) { innerCache = SoftValuedCache . newCache ( 7 ) ; cCache . put ( factory , innerCache ) ; } F instance = ( F ) innerCache . get ( objectType ) ; if ( instance != null ) { return instance ; } if ( objectType == null ) { throw new IllegalArgumentException ( "No object type" ) ; } if ( factory == null ) { throw new IllegalArgumentException ( "No factory type" ) ; } if ( ! factory . isInterface ( ) ) { throw new IllegalArgumentException ( "Factory must be an interface" ) ; } String prefix = objectType . getName ( ) ; if ( prefix . startsWith ( "java." ) ) { // Defining classes in java packages is restricted . int index = prefix . lastIndexOf ( '.' ) ; if ( index > 0 ) { prefix = prefix . substring ( index + 1 ) ; } } ClassInjector ci = ClassInjector . create ( prefix , objectType . getClassLoader ( ) ) ; ClassFile cf = null ; for ( Method method : factory . getMethods ( ) ) { if ( ! Modifier . isAbstract ( method . getModifiers ( ) ) ) { continue ; } Constructor ctor ; try { ctor = objectType . getConstructor ( ( Class [ ] ) method . getParameterTypes ( ) ) ; } catch ( NoSuchMethodException e ) { throw new IllegalArgumentException ( e ) ; } if ( ! method . getReturnType ( ) . isAssignableFrom ( objectType ) ) { throw new IllegalArgumentException ( "Method return type must be \"" + objectType . getName ( ) + "\" or supertype: " + method ) ; } Class < ? > [ ] methodExTypes = method . getExceptionTypes ( ) ; for ( Class < ? > ctorExType : ctor . getExceptionTypes ( ) ) { if ( RuntimeException . class . isAssignableFrom ( ctorExType ) || Error . class . isAssignableFrom ( ctorExType ) ) { continue ; } exCheck : { // Make sure method declares throwing it or a supertype . for ( Class < ? > methodExType : methodExTypes ) { if ( methodExType . isAssignableFrom ( ctorExType ) ) { break exCheck ; } } throw new IllegalArgumentException ( "Method must declare throwing \"" + ctorExType . getName ( ) + "\": " + method ) ; } } if ( cf == null ) { cf = new ClassFile ( ci . getClassName ( ) ) ; cf . setSourceFile ( QuickConstructorGenerator . class . getName ( ) ) ; cf . setTarget ( "1.5" ) ; cf . addInterface ( factory ) ; cf . markSynthetic ( ) ; cf . addDefaultConstructor ( ) ; } // Now define the method that constructs the object . CodeBuilder b = new CodeBuilder ( cf . addMethod ( method ) ) ; b . newObject ( TypeDesc . forClass ( objectType ) ) ; b . dup ( ) ; int count = b . getParameterCount ( ) ; for ( int i = 0 ; i < count ; i ++ ) { b . loadLocal ( b . getParameter ( i ) ) ; } b . invoke ( ctor ) ; b . returnValue ( TypeDesc . OBJECT ) ; } if ( cf == null ) { // No methods found to implement . throw new IllegalArgumentException ( "No methods in factory to implement" ) ; } try { instance = ( F ) ci . defineClass ( cf ) . newInstance ( ) ; } catch ( IllegalAccessException e ) { throw new UndeclaredThrowableException ( e ) ; } catch ( InstantiationException e ) { throw new UndeclaredThrowableException ( e ) ; } innerCache . put ( objectType , instance ) ; return instance ;
public class HDUtils { /** * The path is a human - friendly representation of the deterministic path . For example : * " 44H / 0H / 0H / 1 / 1" * Where a letter " H " means hardened key . Spaces are ignored . */ public static List < ChildNumber > parsePath ( @ Nonnull String path ) { } }
String [ ] parsedNodes = path . replace ( "M" , "" ) . split ( "/" ) ; List < ChildNumber > nodes = new ArrayList < > ( ) ; for ( String n : parsedNodes ) { n = n . replaceAll ( " " , "" ) ; if ( n . length ( ) == 0 ) continue ; boolean isHard = n . endsWith ( "H" ) ; if ( isHard ) n = n . substring ( 0 , n . length ( ) - 1 ) ; int nodeNumber = Integer . parseInt ( n ) ; nodes . add ( new ChildNumber ( nodeNumber , isHard ) ) ; } return nodes ;
public class RestService { /** * Also audit logs . */ protected void authorizeExport ( Map < String , String > headers ) throws AuthorizationException { } }
String path = headers . get ( Listener . METAINFO_REQUEST_PATH ) ; User user = authorize ( path , new JsonObject ( ) , headers ) ; Action action = Action . Export ; Entity entity = getEntity ( path , null , headers ) ; Long entityId = new Long ( 0 ) ; String descrip = path ; if ( descrip . length ( ) > 1000 ) descrip = descrip . substring ( 0 , 999 ) ; UserAction exportAction = new UserAction ( user == null ? "unknown" : user . getName ( ) , action , entity , entityId , descrip ) ; exportAction . setSource ( getSource ( ) ) ; auditLog ( exportAction ) ;
public class Attendee { /** * { @ inheritDoc } */ public final void validate ( ) throws ValidationException { } }
/* * ; the following are optional , ; but MUST NOT occur more than once ( " ; " cutypeparam ) / ( " ; " memberparam ) / ( " ; " * roleparam ) / ( " ; " partstatparam ) / ( " ; " rsvpparam ) / ( " ; " deltoparam ) / ( " ; " delfromparam ) / ( " ; " * sentbyparam ) / ( " ; " cnparam ) / ( " ; " dirparam ) / ( " ; " languageparam ) / */ Arrays . asList ( Parameter . CUTYPE , Parameter . MEMBER , Parameter . ROLE , Parameter . PARTSTAT , Parameter . RSVP , Parameter . DELEGATED_TO , Parameter . DELEGATED_FROM , Parameter . SENT_BY , Parameter . CN , Parameter . DIR , Parameter . LANGUAGE ) . forEach ( parameter -> ParameterValidator . getInstance ( ) . assertOneOrLess ( parameter , getParameters ( ) ) ) ; /* scheduleagent and schedulestatus added for CalDAV scheduling */ ParameterValidator . getInstance ( ) . assertOneOrLess ( Parameter . SCHEDULE_AGENT , getParameters ( ) ) ; ParameterValidator . getInstance ( ) . assertOneOrLess ( Parameter . SCHEDULE_STATUS , getParameters ( ) ) ; /* * ; the following is optional , ; and MAY occur more than once ( " ; " xparam ) */
public class FnShort { /** * It performs the operation target < sup > power < / sup > and returns its value . The result * precision and rounding mode is specified by the given { @ link MathContext } * @ param power the power to raise the target to * @ param mathContext the { @ link MathContext } to specify precision and { @ link RoundingMode } * @ return the result of target < sup > power < / sup > */ public final static Function < Short , Short > pow ( int power , MathContext mathContext ) { } }
return new Pow ( power , mathContext ) ;
public class Log { /** * Logs warning message about the given element . < br > * @ param msg Message * @ param element Offending element * @ author vvakame */ public static void w ( String msg , Element element ) { } }
messager . printMessage ( Diagnostic . Kind . WARNING , msg , element ) ;
public class LssClient { /** * Get your live preset by live preset name . * @ param request The request object containing all parameters for getting live preset . * @ return Your live preset */ public GetPresetResponse getPreset ( GetPresetRequest request ) { } }
checkNotNull ( request , "The parameter request should NOT be null." ) ; checkStringNotEmpty ( request . getName ( ) , "The parameter name should NOT be null or empty string." ) ; InternalRequest internalRequest = createRequest ( HttpMethodName . GET , request , LIVE_PRESET , request . getName ( ) ) ; return invokeHttpClient ( internalRequest , GetPresetResponse . class ) ;
public class BinaryClass { /** * Returns the given input stream ' s contents as a byte array . * If a length is specified ( i . e . if length ! = - 1 ) , only length bytes * are returned . Otherwise all bytes in the stream are returned . * Note this doesn ' t close the stream . * @ throws IOException if a problem occured reading the stream . */ private byte [ ] getInputStreamAsByteArray ( InputStream stream , int length ) throws IOException { } }
byte [ ] contents ; if ( length == - 1 ) { contents = new byte [ 0 ] ; int contentsLength = 0 ; int amountRead = - 1 ; do { int amountRequested = Math . max ( stream . available ( ) , DEFAULT_READING_SIZE ) ; // read at least 8K // resize contents if needed if ( contentsLength + amountRequested > contents . length ) { System . arraycopy ( contents , 0 , contents = new byte [ contentsLength + amountRequested ] , 0 , contentsLength ) ; } // read as many bytes as possible amountRead = stream . read ( contents , contentsLength , amountRequested ) ; if ( amountRead > 0 ) { // remember length of contents contentsLength += amountRead ; } } while ( amountRead != - 1 ) ; // resize contents if necessary if ( contentsLength < contents . length ) { System . arraycopy ( contents , 0 , contents = new byte [ contentsLength ] , 0 , contentsLength ) ; } } else { contents = new byte [ length ] ; int len = 0 ; int readSize = 0 ; while ( ( readSize != - 1 ) && ( len != length ) ) { // See PR 1FMS89U // We record first the read size . In this case len is the actual read size . len += readSize ; readSize = stream . read ( contents , len , length - len ) ; } } return contents ;