signature
stringlengths 43
39.1k
| implementation
stringlengths 0
450k
|
|---|---|
public class CmsJspTagContainer { /** * Ensures the appropriate formatter configuration ID is set in the element settings . < p >
* @ param cms the cms context
* @ param element the element bean
* @ param adeConfig the ADE configuration data
* @ param containerName the container name
* @ param containerType the container type
* @ param containerWidth the container width
* @ return the formatter configuration bean , may be < code > null < / code > if no formatter available or a schema formatter is used */
public static I_CmsFormatterBean ensureValidFormatterSettings ( CmsObject cms , CmsContainerElementBean element , CmsADEConfigData adeConfig , String containerName , String containerType , int containerWidth ) { } }
|
I_CmsFormatterBean formatterBean = getFormatterConfigurationForElement ( cms , element , adeConfig , containerName , containerType , containerWidth ) ; String settingsKey = CmsFormatterConfig . getSettingsKeyForContainer ( containerName ) ; if ( formatterBean != null ) { String formatterConfigId = formatterBean . getId ( ) ; if ( formatterConfigId == null ) { formatterConfigId = CmsFormatterConfig . SCHEMA_FORMATTER_ID + formatterBean . getJspStructureId ( ) . toString ( ) ; } element . getSettings ( ) . put ( settingsKey , formatterConfigId ) ; element . setFormatterId ( formatterBean . getJspStructureId ( ) ) ; } return formatterBean ;
|
public class AmazonWorkLinkClient { /** * Updates the device policy configuration for the fleet .
* @ param updateDevicePolicyConfigurationRequest
* @ return Result of the UpdateDevicePolicyConfiguration operation returned by the service .
* @ throws UnauthorizedException
* You are not authorized to perform this action .
* @ throws InternalServerErrorException
* The service is temporarily unavailable .
* @ throws InvalidRequestException
* The request is not valid .
* @ throws ResourceNotFoundException
* The requested resource was not found .
* @ throws TooManyRequestsException
* The number of requests exceeds the limit .
* @ sample AmazonWorkLink . UpdateDevicePolicyConfiguration
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / worklink - 2018-09-25 / UpdateDevicePolicyConfiguration "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public UpdateDevicePolicyConfigurationResult updateDevicePolicyConfiguration ( UpdateDevicePolicyConfigurationRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeUpdateDevicePolicyConfiguration ( request ) ;
|
public class UnmodifiableTreeMap { /** * This method will take a MutableSortedMap and wrap it directly in a UnmodifiableMutableMap . It will
* take any other non - GS - SortedMap and first adapt it will a SortedMapAdapter , and then return a
* UnmodifiableSortedMap that wraps the adapter . */
public static < K , V , M extends SortedMap < K , V > > UnmodifiableTreeMap < K , V > of ( M map ) { } }
|
if ( map == null ) { throw new IllegalArgumentException ( "cannot create a UnmodifiableSortedMap for null" ) ; } return new UnmodifiableTreeMap < K , V > ( SortedMapAdapter . adapt ( map ) ) ;
|
public class PoolConfigs { /** * Default { @ link GenericObjectPoolConfig } config
* { @ link GenericObjectPoolConfig # getTestOnBorrow } : true
* minIdle : 0
* maxIdle : 8
* maxTotal : 8
* maxWaitMillis : 10000
* minEvictableIdleTimeMillis : 5 minutes
* timeBetweenEvictionRunsMillis : 10 seconds
* @ return */
public static GenericObjectPoolConfig standardConfig ( ) { } }
|
GenericObjectPoolConfig config = new GenericObjectPoolConfig ( ) ; config . setTestOnBorrow ( true ) ; config . setMinIdle ( 0 ) ; config . setMaxIdle ( 8 ) ; config . setMaxTotal ( 8 ) ; config . setMinEvictableIdleTimeMillis ( TimeUnit . MINUTES . toMillis ( 5 ) ) ; config . setTimeBetweenEvictionRunsMillis ( 10000 ) ; config . setMaxWaitMillis ( 10000 ) ; return config ;
|
public class Types { /** * Returns type information for { @ link org . apache . flink . types . Row } with fields of the given types and
* with given names . A row must not be null .
* < p > A row is a fixed - length , null - aware composite type for storing multiple values in a
* deterministic field order . Every field can be null independent of the field ' s type .
* The type of row fields cannot be automatically inferred ; therefore , it is required to provide
* type information whenever a row is used .
* < p > The schema of rows can have up to < code > Integer . MAX _ VALUE < / code > fields , however , all row instances
* must strictly adhere to the schema defined by the type info .
* < p > Example use : { @ code ROW _ NAMED ( new String [ ] { " name " , " number " } , Types . STRING , Types . INT ) } .
* @ param fieldNames array of field names
* @ param types array of field types */
public static TypeInformation < Row > ROW_NAMED ( String [ ] fieldNames , TypeInformation < ? > ... types ) { } }
|
return new RowTypeInfo ( types , fieldNames ) ;
|
public class JSONUtil { /** * 在需要的时候包装对象 < br >
* 包装包括 :
* < ul >
* < li > < code > null < / code > = 》 < code > JSONNull . NULL < / code > < / li >
* < li > array or collection = 》 JSONArray < / li >
* < li > map = 》 JSONObject < / li >
* < li > standard property ( Double , String , et al ) = 》 原对象 < / li >
* < li > 来自于java包 = 》 字符串 < / li >
* < li > 其它 = 》 尝试包装为JSONObject , 否则返回 < code > null < / code > < / li >
* < / ul >
* @ param object 被包装的对象
* @ param ignoreNullValue 是否忽略 { @ code null } 值
* @ return 包装后的值 , null表示此值需被忽略 */
public static Object wrap ( Object object , boolean ignoreNullValue ) { } }
|
if ( object == null ) { return ignoreNullValue ? null : JSONNull . NULL ; } if ( object instanceof JSON || JSONNull . NULL . equals ( object ) || object instanceof JSONString || object instanceof CharSequence || object instanceof Number || ObjectUtil . isBasicType ( object ) ) { return object ; } try { // JSONArray
if ( object instanceof Iterable || ArrayUtil . isArray ( object ) ) { return new JSONArray ( object , ignoreNullValue ) ; } // JSONObject
if ( object instanceof Map ) { return new JSONObject ( object , ignoreNullValue ) ; } // 日期类型原样保存 , 便于格式化
if ( object instanceof Date || object instanceof Calendar ) { return object ; } if ( object instanceof Calendar ) { return ( ( Calendar ) object ) . getTimeInMillis ( ) ; } // 枚举类保存其字符串形式 ( 4.0.2新增 )
if ( object instanceof Enum ) { return object . toString ( ) ; } // Java内部类不做转换
final Class < ? > objectClass = object . getClass ( ) ; final Package objectPackage = objectClass . getPackage ( ) ; final String objectPackageName = objectPackage != null ? objectPackage . getName ( ) : "" ; if ( objectPackageName . startsWith ( "java." ) || objectPackageName . startsWith ( "javax." ) || objectClass . getClassLoader ( ) == null ) { return object . toString ( ) ; } // 默认按照JSONObject对待
return new JSONObject ( object , ignoreNullValue ) ; } catch ( Exception exception ) { return null ; }
|
public class ModelsImpl { /** * Gets information about the entity model .
* @ param appId The application ID .
* @ param versionId The version ID .
* @ param entityId The entity extractor ID .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws ErrorResponseException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the EntityExtractor object if successful . */
public EntityExtractor getEntity ( UUID appId , String versionId , UUID entityId ) { } }
|
return getEntityWithServiceResponseAsync ( appId , versionId , entityId ) . toBlocking ( ) . single ( ) . body ( ) ;
|
public class PojoBuilder { /** * Generates implementations for hashCode ( ) , equals ( ) and toString ( ) methods
* if the plugin has been configured to do so .
* @ param excludeFieldsFromToString
* list of parameters to exclude from toString ( ) method */
public void withOverridenMethods ( List < String > excludeFieldsFromToString ) { } }
|
if ( Config . getPojoConfig ( ) . isIncludeHashcodeAndEquals ( ) ) { withHashCode ( ) ; withEquals ( ) ; } if ( Config . getPojoConfig ( ) . isIncludeToString ( ) ) { withToString ( excludeFieldsFromToString ) ; }
|
public class SpScheduler { /** * Offer all fragment tasks and complete transaction tasks queued for durability for the given
* MP transaction , and remove the entry from the pending map so that future ones won ' t be
* queued .
* @ param txnId The MP transaction ID . */
public void offerPendingMPTasks ( long txnId ) { } }
|
Queue < TransactionTask > pendingTasks = m_mpsPendingDurability . get ( txnId ) ; if ( pendingTasks != null ) { for ( TransactionTask task : pendingTasks ) { if ( task instanceof SpProcedureTask ) { final VoltTrace . TraceEventBatch traceLog = VoltTrace . log ( VoltTrace . Category . SPI ) ; if ( traceLog != null ) { traceLog . add ( ( ) -> VoltTrace . endAsync ( "durability" , MiscUtils . hsIdTxnIdToString ( m_mailbox . getHSId ( ) , task . getSpHandle ( ) ) ) ) ; } } else if ( task instanceof FragmentTask ) { final VoltTrace . TraceEventBatch traceLog = VoltTrace . log ( VoltTrace . Category . SPI ) ; if ( traceLog != null ) { traceLog . add ( ( ) -> VoltTrace . endAsync ( "durability" , MiscUtils . hsIdTxnIdToString ( m_mailbox . getHSId ( ) , ( ( FragmentTask ) task ) . m_fragmentMsg . getSpHandle ( ) ) ) ) ; } } m_pendingTasks . offer ( task ) ; } m_mpsPendingDurability . remove ( txnId ) ; }
|
public class Log { /** * Wil log a text with the WARN level . */
public static void warnFormatted ( final Exception exception ) { } }
|
logWriterInstance . warn ( exception ) ; UaiWebSocketLogManager . addLogText ( "[WARN] An exception just happened: " + exception . getMessage ( ) ) ;
|
public class LevenbergMarquardt { /** * Performs sanity checks on the input data and reshapes internal matrices . By reshaping
* a matrix it will only declare new memory when needed . */
protected void configure ( DenseMatrix64F initParam , DenseMatrix64F X , DenseMatrix64F Y ) { } }
|
if ( Y . getNumRows ( ) != X . getNumRows ( ) ) { throw new IllegalArgumentException ( "Different vector lengths" ) ; } else if ( Y . getNumCols ( ) != 1 /* | | X . getNumCols ( ) ! = 1 */
) { throw new IllegalArgumentException ( "Inputs must be a column vector" ) ; } int numParam = initParam . getNumElements ( ) ; int numPoints = Y . getNumRows ( ) ; if ( param . getNumElements ( ) != initParam . getNumElements ( ) ) { // reshaping a matrix means that new memory is only declared when needed
this . param . reshape ( numParam , 1 , false ) ; this . d . reshape ( numParam , 1 , false ) ; this . H . reshape ( numParam , numParam , false ) ; this . negDelta . reshape ( numParam , 1 , false ) ; this . tempParam . reshape ( numParam , 1 , false ) ; this . A . reshape ( numParam , numParam , false ) ; } param . set ( initParam ) ; // reshaping a matrix means that new memory is only declared when needed
temp0 . reshape ( numPoints , 1 , false ) ; temp1 . reshape ( numPoints , 1 , false ) ; tempDH . reshape ( numPoints , 1 , false ) ; jacobian . reshape ( numParam , numPoints , false ) ;
|
public class Util { /** * Transform an { @ link Match } [ ] into an { @ link Element } [ ] , removing duplicates . */
static final Element [ ] elements ( Match ... content ) { } }
|
Set < Element > result = new LinkedHashSet < Element > ( ) ; for ( Match x : content ) result . addAll ( x . get ( ) ) ; return result . toArray ( new Element [ result . size ( ) ] ) ;
|
public class RowServiceSkinny { /** * { @ inheritDoc } */
protected List < Row > rows ( List < SearchResult > searchResults , long timestamp , boolean usesRelevance ) { } }
|
List < Row > rows = new ArrayList < > ( searchResults . size ( ) ) ; for ( SearchResult searchResult : searchResults ) { // Extract row from document
DecoratedKey partitionKey = searchResult . getPartitionKey ( ) ; Row row = row ( partitionKey , timestamp ) ; if ( row == null ) { return null ; } // Return decorated row
if ( usesRelevance ) { Float score = searchResult . getScore ( ) ; Row decoratedRow = addScoreColumn ( row , timestamp , score ) ; rows . add ( decoratedRow ) ; } else { rows . add ( row ) ; } } return rows ;
|
public class Canon { /** * Internal - refine invariants to a canonical labelling and
* symmetry classes .
* @ param invariants the invariants to refine ( canonical labelling gets
* written here )
* @ param hydrogens binary vector of terminal hydrogens
* @ return the symmetry classes */
private long [ ] refine ( long [ ] invariants , boolean [ ] hydrogens ) { } }
|
int ord = g . length ; InvariantRanker ranker = new InvariantRanker ( ord ) ; // current / next vertices , these only hold the vertices which are
// equivalent
int [ ] currVs = new int [ ord ] ; int [ ] nextVs = new int [ ord ] ; // fill with identity ( also set number of non - unique )
int nnu = ord ; for ( int i = 0 ; i < ord ; i ++ ) currVs [ i ] = i ; long [ ] prev = invariants ; long [ ] curr = Arrays . copyOf ( invariants , ord ) ; // initially all labels are 1 , the input invariants are then used to
// refine this coarse partition
Arrays . fill ( prev , 1L ) ; // number of ranks
int n = 0 , m = 0 ; // storage of symmetry classes
long [ ] symmetry = null ; while ( n < ord ) { // refine the initial invariants using product of primes from
// adjacent ranks
while ( ( n = ranker . rank ( currVs , nextVs , nnu , curr , prev ) ) > m && n < ord ) { nnu = 0 ; for ( int i = 0 ; i < ord && nextVs [ i ] >= 0 ; i ++ ) { int v = nextVs [ i ] ; currVs [ nnu ++ ] = v ; curr [ v ] = hydrogens [ v ] ? prev [ v ] : primeProduct ( g [ v ] , prev , hydrogens ) ; } m = n ; } if ( symmetry == null ) { // After symmetry classes have been found without hydrogens we add
// back in the hydrogens and assign ranks . We don ' t refine the
// partition until the next time round the while loop to avoid
// artificially splitting due to hydrogen representation , for example
// the two hydrogens are equivalent in this SMILES for ethane ' [ H ] CC '
for ( int i = 0 ; i < g . length ; i ++ ) { if ( hydrogens [ i ] ) { curr [ i ] = prev [ g [ i ] [ 0 ] ] ; hydrogens [ i ] = false ; } } n = ranker . rank ( currVs , nextVs , nnu , curr , prev ) ; symmetry = Arrays . copyOf ( prev , ord ) ; // Update the buffer of non - unique vertices as hydrogens next
// to discrete heavy atoms are also discrete ( and removed from
// ' nextVs ' during ranking .
nnu = 0 ; for ( int i = 0 ; i < ord && nextVs [ i ] >= 0 ; i ++ ) { currVs [ nnu ++ ] = nextVs [ i ] ; } } // partition is discrete or only symmetry classes are needed
if ( symOnly || n == ord ) return symmetry ; // artificially split the lowest cell , we perturb the value
// of all vertices with equivalent rank to the lowest non - unique
// vertex
int lo = nextVs [ 0 ] ; for ( int i = 1 ; i < ord && nextVs [ i ] >= 0 && prev [ nextVs [ i ] ] == prev [ lo ] ; i ++ ) prev [ nextVs [ i ] ] ++ ; // could also swap but this is cleaner
System . arraycopy ( nextVs , 0 , currVs , 0 , nnu ) ; } return symmetry ;
|
public class AbstractProcessJob { /** * Get Environment Variables from the Job Properties Table
* @ return All Job Properties with " env . " prefix */
public Map < String , String > getEnvironmentVariables ( ) { } }
|
final Props props = getJobProps ( ) ; final Map < String , String > envMap = props . getMapByPrefix ( ENV_PREFIX ) ; return envMap ;
|
public class IRBuilderMethods { /** * - - - - - Method Calls - - - - - */
public static IRMethodCallExpressionBuilder call ( String name , IRExpressionBuilder ... args ) { } }
|
return call ( _this ( ) , name , args ) ;
|
public class PubSubInputHandler { /** * ( non - Javadoc )
* @ see com . ibm . ws . sib . processor . impl . interfaces . ControlHandler # handleControlMessage ( com . ibm . ws . sib . trm . topology . Cellule , com . ibm . ws . sib . mfp . control . ControlMessage )
* TODO maybe we should have separate upStream and downStream versions of this method */
@ Override public void handleControlMessage ( SIBUuid8 sourceMEUuid , ControlMessage cMsg ) throws SIIncorrectCallException , SIErrorException , SIResourceException { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "handleControlMessage" , new Object [ ] { cMsg } ) ; // Note that this method is called by the PubSubOutputHandler
// and not by the RemoteMessageReceiver for Ack , Nack , RequestFlush
// and AreYouFlushed messages
// Work out type of ControlMessage and process it
ControlMessageType type = cMsg . getControlMessageType ( ) ; // IMPORTANT : do the flush related messages first so that we answer
// consistently with respect to any in progress flush .
if ( type == ControlMessageType . REQUESTFLUSH ) { // TODO : this should invoke some higher - level interface indicating that
// our target wants to be flushed .
} // Now we can process the rest of the control messages . . .
// Someone downstream has completed an ack prefix
// or can ' t handle a nack .
else if ( type == ControlMessageType . ACK ) { processAck ( ( ControlAck ) cMsg ) ; } else if ( type == ControlMessageType . NACK ) { processNack ( ( ControlNack ) cMsg ) ; } else if ( type == ControlMessageType . ACKEXPECTED ) { processAckExpected ( ( ControlAckExpected ) cMsg ) ; } else { // call the super class to handle downstream ( target ) control messages
super . handleControlMessage ( sourceMEUuid , cMsg ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "handleControlMessage" ) ;
|
public class Member { /** * Issue a query request on behalf of this member .
* @ param queryRequest { @ link QueryRequest }
* @ throws ChainCodeException if the query transaction fails */
public ChainCodeResponse query ( QueryRequest queryRequest ) throws ChainCodeException , NoAvailableTCertException , CryptoException , IOException { } }
|
logger . debug ( "Member.query" ) ; if ( getChain ( ) . getPeers ( ) . isEmpty ( ) ) { throw new NoValidPeerException ( String . format ( "chain %s has no peers" , getChain ( ) . getName ( ) ) ) ; } TransactionContext tcxt = this . newTransactionContext ( null ) ; return tcxt . query ( queryRequest ) ;
|
public class UriEscape { /** * Perform am URI fragment identifier < strong > escape < / strong > operation
* on a < tt > char [ ] < / tt > input using < tt > UTF - 8 < / tt > as encoding .
* The following are the only allowed chars in an URI fragment identifier ( will not be escaped ) :
* < ul >
* < li > < tt > A - Z a - z 0-9 < / tt > < / li >
* < li > < tt > - . _ ~ < / tt > < / li >
* < li > < tt > ! $ & amp ; ' ( ) * + , ; = < / tt > < / li >
* < li > < tt > : @ < / tt > < / li >
* < li > < tt > / ? < / tt > < / li >
* < / ul >
* All other chars will be escaped by converting them to the sequence of bytes that
* represents them in the < tt > UTF - 8 < / tt > and then representing each byte
* in < tt > % HH < / tt > syntax , being < tt > HH < / tt > the hexadecimal representation of the byte .
* This method is < strong > thread - safe < / strong > .
* @ param text the < tt > char [ ] < / tt > to be escaped .
* @ param offset the position in < tt > text < / tt > at which the escape operation should start .
* @ param len the number of characters in < tt > text < / tt > that should be escaped .
* @ param writer the < tt > java . io . Writer < / tt > to which the escaped result will be written . Nothing will
* be written at all to this writer if input is < tt > null < / tt > .
* @ throws IOException if an input / output exception occurs */
public static void escapeUriFragmentId ( final char [ ] text , final int offset , final int len , final Writer writer ) throws IOException { } }
|
escapeUriFragmentId ( text , offset , len , writer , DEFAULT_ENCODING ) ;
|
public class NodewalkerCodec { /** * Read forward .
* @ param decoder the decoder
* @ throws IOException the io exception */
protected void readForward ( Decoder decoder ) throws IOException { } }
|
short numberOfTokens = decoder . in . readVarShort ( 3 ) ; if ( 0 < numberOfTokens ) { long seek = decoder . in . peekLongCoord ( decoder . node . getCursorCount ( ) ) ; TrieNode toNode = decoder . node . traverse ( seek + decoder . node . getCursorIndex ( ) ) ; while ( toNode . getDepth ( ) > decoder . node . getDepth ( ) + numberOfTokens ) toNode = toNode . getParent ( ) ; Interval interval = decoder . node . intervalTo ( toNode ) ; String str = toNode . getString ( decoder . node ) ; Bits bits = interval . toBits ( ) ; if ( verbose != null ) { verbose . println ( String . format ( "Read %s forward from %s to %s = %s" , numberOfTokens , decoder . node . getDebugString ( ) , toNode . getDebugString ( ) , bits ) ) ; } decoder . in . expect ( bits ) ; decoder . out . append ( str ) ; decoder . node = toNode ; } else { assert ( 0 == decoder . node . index ) ; }
|
public class PresentsConnectionManager { /** * Called by a connection when it has a downstream message that needs to be delivered .
* < em > Note : < / em > this method is called as a result of a call to
* { @ link PresentsConnection # postMessage } which happens when forwarding an event to a client
* and at the completion of authentication , both of which < em > must < / em > happen only on the
* distributed object thread . */
protected void postMessage ( PresentsConnection conn , Message msg ) { } }
|
if ( ! isRunning ( ) ) { log . warning ( "Posting message to inactive connection manager" , "msg" , msg , new Exception ( ) ) ; } // sanity check
if ( conn == null || msg == null ) { log . warning ( "postMessage() bogosity" , "conn" , conn , "msg" , msg , new Exception ( ) ) ; return ; } // more sanity check ; messages must only be posted from the dobjmgr thread
if ( ! _omgr . isDispatchThread ( ) ) { log . warning ( "Message posted on non-distributed object thread" , "conn" , conn , "msg" , msg , "thread" , Thread . currentThread ( ) , new Exception ( ) ) ; // let it through though as we don ' t want to break things unnecessarily
} try { // send it as a datagram if hinted and possible ( pongs must be sent as part of the
// negotation process )
if ( ! msg . getTransport ( ) . isReliable ( ) && ( conn . getTransmitDatagrams ( ) || msg instanceof PongResponse ) && postDatagram ( conn , msg ) ) { return ; } // note the actual transport
msg . noteActualTransport ( Transport . RELIABLE_ORDERED ) ; _framer . resetFrame ( ) ; // flatten this message using the connection ' s output stream
ObjectOutputStream oout = conn . getObjectOutputStream ( _framer ) ; oout . writeObject ( msg ) ; oout . flush ( ) ; // now extract that data into a byte array
ByteBuffer buffer = _framer . frameAndReturnBuffer ( ) ; byte [ ] data = new byte [ buffer . limit ( ) ] ; buffer . get ( data ) ; // log . info ( " Flattened " + msg + " into " + data . length + " bytes . " ) ;
// and slap both on the queue
_outq . append ( Tuple . < Connection , byte [ ] > newTuple ( conn , data ) ) ; } catch ( Exception e ) { log . warning ( "Failure flattening message" , "conn" , conn , "msg" , msg , e ) ; }
|
public class ParameterDefinition { /** * A list of AWS SAM resources that use this parameter .
* @ param referencedByResources
* A list of AWS SAM resources that use this parameter . */
public void setReferencedByResources ( java . util . Collection < String > referencedByResources ) { } }
|
if ( referencedByResources == null ) { this . referencedByResources = null ; return ; } this . referencedByResources = new java . util . ArrayList < String > ( referencedByResources ) ;
|
import java . util . * ; class ModifyWordCase { /** * A java function to change the first and last characters of each word in a string to uppercase .
* > > > modify _ word _ case ( ' python ' )
* ' PythoN '
* > > > modify _ word _ case ( ' bigdata ' )
* ' BigdatA '
* > > > modify _ word _ case ( ' Hadoop ' )
* ' HadooP ' */
public static String modifyWordCase ( String inputStr ) { } }
|
String tmp = "" ; String [ ] words = inputStr . split ( " " ) ; for ( String word : words ) { word = String . valueOf ( word . charAt ( 0 ) ) . toUpperCase ( ) + word . substring ( 1 ) ; int lastIdx = word . length ( ) - 1 ; word = word . substring ( 0 , lastIdx ) + String . valueOf ( word . charAt ( lastIdx ) ) . toUpperCase ( ) ; tmp += ( word + " " ) ; } return tmp . trim ( ) ;
|
public class HC_Target { /** * Try to find one of the default targets by name . The name comparison is
* performed case insensitive .
* @ param sName
* The name to check . May not be < code > null < / code > .
* @ param aDefault
* The default value to be returned in case the name was never found .
* May be < code > null < / code > .
* @ return The constant link target representing the name or the default
* value . May be < code > null < / code > if the passed default value is
* < code > null < / code > and the name was not found . */
@ Nullable public static HC_Target getFromName ( @ Nonnull final String sName , @ Nullable final HC_Target aDefault ) { } }
|
if ( BLANK . getAttrValue ( ) . equalsIgnoreCase ( sName ) ) return BLANK ; if ( SELF . getAttrValue ( ) . equalsIgnoreCase ( sName ) ) return SELF ; if ( PARENT . getAttrValue ( ) . equalsIgnoreCase ( sName ) ) return PARENT ; if ( TOP . getAttrValue ( ) . equalsIgnoreCase ( sName ) ) return TOP ; return aDefault ;
|
public class GVRSkeleton { /** * Compute the skinning matrices from the current pose .
* The skin pose is relative to the untransformed mesh .
* It will be used to transform the vertices before
* overall translate , rotation and scale are performed .
* It is the current pose relative to the bind pose
* of the mesh .
* Each skinned mesh has an associated @ { link GVRSkin } component
* which manages the bones that affect that mesh .
* This function updates the GPU skinning matrices each frame .
* @ see GVRSkin */
public void updateBonePose ( ) { } }
|
GVRPose pose = getPose ( ) ; int t = 0 ; for ( int i = 0 ; i < mParentBones . length ; ++ i ) { pose . getLocalMatrix ( i , mTempMtx ) ; mTempMtx . get ( mPoseMatrices , t ) ; t += 16 ; } NativeSkeleton . setPose ( getNative ( ) , mPoseMatrices ) ;
|
public class NetworkInit { /** * Get address for given IP .
* @ param ip textual representation of IP ( host )
* @ return IPv4 or IPv6 address which matches given IP and is in specified range */
private static InetAddress getInetAddress ( String ip ) { } }
|
if ( ip == null ) return null ; InetAddress addr = null ; try { addr = InetAddress . getByName ( ip ) ; } catch ( UnknownHostException e ) { Log . err ( e ) ; H2O . exit ( - 1 ) ; } return addr ;
|
public class ImageUtils { /** * Clones a BufferedImage .
* @ param image the image to clone
* @ return the cloned image */
public static BufferedImage cloneImage ( BufferedImage image ) { } }
|
BufferedImage newImage = new BufferedImage ( image . getWidth ( ) , image . getHeight ( ) , BufferedImage . TYPE_INT_ARGB ) ; Graphics2D g = newImage . createGraphics ( ) ; g . drawRenderedImage ( image , null ) ; g . dispose ( ) ; return newImage ;
|
public class LBiObjIntConsumerBuilder { /** * One of ways of creating builder . This is possibly the least verbose way where compiler should be able to guess the generic parameters . */
@ Nonnull public static < T1 , T2 > LBiObjIntConsumer < T1 , T2 > biObjIntConsumerFrom ( Consumer < LBiObjIntConsumerBuilder < T1 , T2 > > buildingFunction ) { } }
|
LBiObjIntConsumerBuilder builder = new LBiObjIntConsumerBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ;
|
public class HttpUtils { /** * Adds a param value to a params map . If value is null , nothing is done .
* @ param key the param key
* @ param value the param value
* @ param params the params map */
public static void addValue ( String key , Object value , MultiValueMap < String , String > params ) { } }
|
if ( value != null ) { params . add ( key , value . toString ( ) ) ; }
|
public class SIPRegistrarSbb { /** * util methods */
private String getCanonicalAddress ( HeaderAddress header ) { } }
|
String addr = header . getAddress ( ) . getURI ( ) . toString ( ) ; int index = addr . indexOf ( ':' ) ; index = addr . indexOf ( ':' , index + 1 ) ; if ( index != - 1 ) { // Get rid of the port
addr = addr . substring ( 0 , index ) ; } return addr ;
|
public class Coordinate { /** * Tests if another coordinate has the same values for the X , Y and Z ordinates .
* @ param other
* a < code > Coordinate < / code > with which to do the 3D comparison .
* @ return true if < code > other < / code > is a < code > Coordinate < / code > with the same values for X , Y
* and Z . */
public boolean equals3D ( final Coordinate other ) { } }
|
return getX ( ) == other . getX ( ) && getY ( ) == other . getY ( ) && ( getZ ( ) == other . getZ ( ) || Double . isNaN ( getZ ( ) ) && Double . isNaN ( other . getZ ( ) ) ) ;
|
public class ActionRequestProcessor { protected void beginInOutLoggingIfNeeds ( LocalDateTime beginTime , String processHash ) { } }
|
InOutLogKeeper . prepare ( getRequestManager ( ) ) . ifPresent ( keeper -> { keeper . keepBeginDateTime ( beginTime ) ; keeper . keepProcessHash ( processHash ) ; } ) ;
|
public class AdGroupCriterionLimitExceeded { /** * Gets the limitType value for this AdGroupCriterionLimitExceeded .
* @ return limitType */
public com . google . api . ads . adwords . axis . v201809 . cm . AdGroupCriterionLimitExceededCriteriaLimitType getLimitType ( ) { } }
|
return limitType ;
|
public class HlsAkamaiSettingsMarshaller { /** * Marshall the given parameter object . */
public void marshall ( HlsAkamaiSettings hlsAkamaiSettings , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( hlsAkamaiSettings == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( hlsAkamaiSettings . getConnectionRetryInterval ( ) , CONNECTIONRETRYINTERVAL_BINDING ) ; protocolMarshaller . marshall ( hlsAkamaiSettings . getFilecacheDuration ( ) , FILECACHEDURATION_BINDING ) ; protocolMarshaller . marshall ( hlsAkamaiSettings . getHttpTransferMode ( ) , HTTPTRANSFERMODE_BINDING ) ; protocolMarshaller . marshall ( hlsAkamaiSettings . getNumRetries ( ) , NUMRETRIES_BINDING ) ; protocolMarshaller . marshall ( hlsAkamaiSettings . getRestartDelay ( ) , RESTARTDELAY_BINDING ) ; protocolMarshaller . marshall ( hlsAkamaiSettings . getSalt ( ) , SALT_BINDING ) ; protocolMarshaller . marshall ( hlsAkamaiSettings . getToken ( ) , TOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class FacesConfigurator { /** * private String getLifecycleId ( )
* String id = _ externalContext . getInitParameter ( FacesServlet . LIFECYCLE _ ID _ ATTR ) ;
* if ( id ! = null )
* return id ;
* return LifecycleFactory . DEFAULT _ LIFECYCLE ; */
private void handleSerialFactory ( ) { } }
|
String serialProvider = _externalContext . getInitParameter ( StateUtils . SERIAL_FACTORY ) ; SerialFactory serialFactory = null ; if ( serialProvider == null ) { serialFactory = new DefaultSerialFactory ( ) ; } else { try { serialFactory = ( SerialFactory ) ClassUtils . newInstance ( serialProvider ) ; } catch ( ClassCastException e ) { log . log ( Level . SEVERE , "Make sure '" + serialProvider + "' implements the correct interface" , e ) ; } catch ( Exception e ) { log . log ( Level . SEVERE , "" , e ) ; } finally { if ( serialFactory == null ) { serialFactory = new DefaultSerialFactory ( ) ; log . severe ( "Using default serialization provider" ) ; } } } log . info ( "Serialization provider : " + serialFactory . getClass ( ) ) ; _externalContext . getApplicationMap ( ) . put ( StateUtils . SERIAL_FACTORY , serialFactory ) ;
|
public class ClientDObjectMgr { /** * This is guaranteed to be invoked via the invoker and can safely do main thread type things
* like call back to the subscriber . */
protected void doUnsubscribe ( int oid , Subscriber < ? > target ) { } }
|
DObject dobj = _ocache . get ( oid ) ; if ( dobj != null ) { dobj . removeSubscriber ( target ) ; } else if ( _client . isFailureLoggable ( Client . FailureType . UNSUBSCRIBE_NOT_PROXIED ) ) { log . info ( "Requested to remove subscriber from non-proxied object" , "oid" , oid , "sub" , target ) ; }
|
public class BitfinexCurrencyPair { /** * Construct from string
* @ param symbolString
* @ return */
public static BitfinexCurrencyPair fromSymbolString ( final String symbolString ) { } }
|
for ( final BitfinexCurrencyPair currency : BitfinexCurrencyPair . values ( ) ) { if ( currency . toBitfinexString ( ) . equalsIgnoreCase ( symbolString ) ) { return currency ; } } throw new IllegalArgumentException ( "Unable to find currency pair for: " + symbolString ) ;
|
public class DeleteItemResult { /** * If the < code > ReturnValues < / code > parameter is provided as
* < code > ALL _ OLD < / code > in the request , Amazon DynamoDB returns an array
* of attribute name - value pairs ( essentially , the deleted item ) .
* Otherwise , the response contains an empty set .
* Returns a reference to this object so that method calls can be chained together .
* @ param attributes If the < code > ReturnValues < / code > parameter is provided as
* < code > ALL _ OLD < / code > in the request , Amazon DynamoDB returns an array
* of attribute name - value pairs ( essentially , the deleted item ) .
* Otherwise , the response contains an empty set .
* @ return A reference to this updated object so that method calls can be chained
* together . */
public DeleteItemResult withAttributes ( java . util . Map < String , AttributeValue > attributes ) { } }
|
setAttributes ( attributes ) ; return this ;
|
public class QueuePlugin { /** * Adds new functions , to be executed , onto the end of the effects
* queue of all matched elements . */
@ SuppressWarnings ( "unchecked" ) public T queue ( Function ... funcs ) { } }
|
for ( Element e : elements ( ) ) { for ( Function f : funcs ) { queue ( e , DEFAULT_NAME , f ) ; } } return ( T ) this ;
|
public class LatentRelationalAnalysis { /** * Initializes an index given the index directory and data directory .
* @ param indexDir a { @ code String } containing the directory where the index
* will be stored
* @ param dataDir a { @ code String } containing the directory where the data
* is found */
public static void initializeIndex ( String indexDir , String dataDir ) { } }
|
File indexDir_f = new File ( indexDir ) ; File dataDir_f = new File ( dataDir ) ; long start = new Date ( ) . getTime ( ) ; try { int numIndexed = index ( indexDir_f , dataDir_f ) ; long end = new Date ( ) . getTime ( ) ; System . err . println ( "Indexing " + numIndexed + " files took " + ( end - start ) + " milliseconds" ) ; } catch ( IOException e ) { System . err . println ( "Unable to index " + indexDir_f + ": " + e . getMessage ( ) ) ; }
|
public class UserInfoImpl { /** * / * ( non - Javadoc )
* @ see com . tvd12 . ezyfox . core . command . FetchUserInfo # getPlayerIds ( ) */
@ Override public Map < ApiRoom , Integer > getPlayerIds ( ) { } }
|
Map < ApiRoom , Integer > anwser = new HashMap < > ( ) ; Map < Room , Integer > ids = sfsUser . getPlayerIds ( ) ; for ( Entry < Room , Integer > entry : ids . entrySet ( ) ) anwser . put ( ( ApiRoom ) entry . getKey ( ) . getProperty ( APIKey . ROOM ) , entry . getValue ( ) ) ; return anwser ; } /* ( non - Javadoc )
* @ see com . tvd12 . ezyfox . core . command . FetchUserInfo # getReconnectionSeconds ( ) */
@ Override public int getReconnectionSeconds ( ) { return sfsUser . getReconnectionSeconds ( ) ; } /* ( non - Javadoc )
* @ see com . tvd12 . ezyfox . core . command . FetchUserInfo # getSubscribedGroups ( ) */
@ Override public List < String > getSubscribedGroups ( ) { return sfsUser . getSubscribedGroups ( ) ; } /* ( non - Javadoc )
* @ see com . tvd12 . ezyfox . core . command . FetchUserInfo # getVariablesCount ( ) */
@ Override public int getVariablesCount ( ) { return sfsUser . getVariablesCount ( ) ; } /* ( non - Javadoc )
* @ see com . tvd12 . ezyfox . core . command . FetchUserInfo # getZone ( ) */
@ Override public ApiZone getZone ( ) { return ( ApiZone ) sfsUser . getZone ( ) . getProperty ( APIKey . ZONE ) ; } /* ( non - Javadoc )
* @ see com . tvd12 . ezyfox . core . command . UpdateUserInfo # removeAllVariables ( ) */
@ Override public void removeAllVariables ( ) { List < UserVariable > vars = sfsUser . getVariables ( ) ; for ( UserVariable var : vars ) var . setNull ( ) ; api . setUserVariables ( sfsUser , vars ) ; } /* ( non - Javadoc )
* @ see com . tvd12 . ezyfox . core . command . UserInfo # user ( com . tvd12 . ezyfox . core . entities . ApiBaseUser ) */
@ Override public UserInfo user ( ApiBaseUser user ) { sfsUser = getSfsUser ( user , api ) ; return this ; } /* ( non - Javadoc )
* @ see com . tvd12 . ezyfox . core . command . UserInfo # user ( java . lang . String ) */
@ Override public UserInfo user ( String username ) { sfsUser = getSfsUser ( username , api ) ; return this ; } /* ( non - Javadoc )
* @ see com . tvd12 . ezyfox . core . command . UserInfo # user ( int ) */
@ Override public UserInfo user ( int userId ) { sfsUser = api . getUserById ( userId ) ; return this ; } /* ( non - Javadoc )
* @ see com . tvd12 . ezyfox . core . command . UpdateUserInfo # disconnect ( byte ) */
@ Override public void disconnect ( final byte reasonId ) { sfsUser . disconnect ( new IDisconnectionReason ( ) { @ Override public int getValue ( ) { return getByteValue ( ) ; } @ Override public byte getByteValue ( ) { return reasonId ; } } ) ; }
|
public class IncludeProjectDependenciesComponentConfigurator { /** * ConfigurationListener listener ) throws ComponentConfigurationException { */
@ Override public void configureComponent ( final Object component , final PlexusConfiguration configuration , final ExpressionEvaluator expressionEvaluator , final ClassRealm containerRealm , final ConfigurationListener listener ) throws ComponentConfigurationException { } }
|
addProjectDependenciesToClassRealm ( expressionEvaluator , containerRealm ) ; this . converterLookup . registerConverter ( new ClassRealmConverter ( containerRealm ) ) ; final ObjectWithFieldsConverter converter = new ObjectWithFieldsConverter ( ) ; converter . processConfiguration ( this . converterLookup , component , containerRealm , configuration , expressionEvaluator , listener ) ;
|
public class ListFormatter { /** * Returns the pattern to use for a particular item count .
* @ param count the item count .
* @ return the pattern with { 0 } , { 1 } , { 2 } , etc . For English ,
* getPatternForNumItems ( 3 ) = = " { 0 } , { 1 } , and { 2 } "
* @ throws IllegalArgumentException when count is 0 or negative . */
public String getPatternForNumItems ( int count ) { } }
|
if ( count <= 0 ) { throw new IllegalArgumentException ( "count must be > 0" ) ; } ArrayList < String > list = new ArrayList < String > ( ) ; for ( int i = 0 ; i < count ; i ++ ) { list . add ( String . format ( "{%d}" , i ) ) ; } return format ( list ) ;
|
public class MessageBuilder { /** * Creates a ZabMessage . ClusterConfiguration object .
* @ param config the ClusterConfiguration object .
* @ return protobuf ClusterConfiguration object . */
public static ZabMessage . ClusterConfiguration buildConfig ( ClusterConfiguration config ) { } }
|
ZabMessage . Zxid version = toProtoZxid ( config . getVersion ( ) ) ; return ZabMessage . ClusterConfiguration . newBuilder ( ) . setVersion ( version ) . addAllServers ( config . getPeers ( ) ) . build ( ) ;
|
public class DependencyRandomIndexing { /** * Returns the current semantic vector for the provided word . If the word
* is not currently in the semantic space , a vector is added for it and
* returned .
* @ param word a word that requires a semantic vector
* @ return the { @ code SemanticVector } representing { @ code word } */
private IntegerVector getSemanticVector ( String word ) { } }
|
IntegerVector v = wordSpace . get ( word ) ; if ( v == null ) { // lock on the word in case multiple threads attempt to add it at
// once
synchronized ( this ) { // recheck in case another thread added it while we were waiting
// for the lock
v = wordSpace . get ( word ) ; if ( v == null ) { v = new CompactSparseIntegerVector ( vectorLength ) ; wordSpace . put ( word , v ) ; } } } return v ;
|
public class AbstractItemLink { /** * Feature SIB0112le . ms . 1 */
@ Override public final List < DataSlice > readDataFromPersistence ( ) throws SevereMessageStoreException { } }
|
List < DataSlice > dataSlices ; // lazy restoration only needed if the item was stored . There is
// no point trying to restore if there is no data .
PersistentMessageStore pm = getMessageStoreImpl ( ) . getPersistentMessageStore ( ) ; try { dataSlices = pm . readDataOnly ( getTuple ( ) ) ; } catch ( PersistenceException pe ) { com . ibm . ws . ffdc . FFDCFilter . processException ( pe , "com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.readDataFromPersistence" , "1:3271:1.241" , this ) ; throw new SevereMessageStoreException ( pe ) ; } return dataSlices ;
|
public class StopCrawlerScheduleRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( StopCrawlerScheduleRequest stopCrawlerScheduleRequest , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( stopCrawlerScheduleRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( stopCrawlerScheduleRequest . getCrawlerName ( ) , CRAWLERNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class br_restoreconfig { /** * < pre >
* Use this operation to restore config from file on Repeater Instances .
* < / pre > */
public static br_restoreconfig restoreconfig ( nitro_service client , br_restoreconfig resource ) throws Exception { } }
|
return ( ( br_restoreconfig [ ] ) resource . perform_operation ( client , "restoreconfig" ) ) [ 0 ] ;
|
public class EnumParameterTypeImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public FeatureMap getParameterValueGroup ( ) { } }
|
return ( FeatureMap ) getGroup ( ) . < FeatureMap . Entry > list ( BpsimPackage . Literals . ENUM_PARAMETER_TYPE__PARAMETER_VALUE_GROUP ) ;
|
public class TimeSeries { /** * Gets the valuePeriodType value for this TimeSeries .
* @ return valuePeriodType * The period of each time series value ( e . g . daily or custom ) . */
public com . google . api . ads . admanager . axis . v201902 . PeriodType getValuePeriodType ( ) { } }
|
return valuePeriodType ;
|
public class FireAllCommands { /** * Generate command .
* @ param exchange the exchange
* @ throws Exception the exception */
public void generateCommand ( Exchange exchange ) throws Exception { } }
|
System . out . println ( ">> We will fire all rules commands" ) ; FireAllRulesCommand fireAllRulesCommand = new FireAllRulesCommand ( ) ; exchange . getIn ( ) . setBody ( fireAllRulesCommand ) ;
|
public class AbstractHttpTransport { /** * / * ( non - Javadoc )
* @ see com . ibm . jaggr . service . deps . IDependenciesListener # dependenciesLoaded ( com . ibm . jaggr . service . deps . IDependencies , long ) */
@ Override public void dependenciesLoaded ( IDependencies deps , long sequence ) { } }
|
/* * Aggregate the dependent features from all the modules into a single ,
* alphabetically sorted , list of features . */
Set < String > features = new TreeSet < String > ( ) ; try { for ( String mid : deps . getDependencyNames ( ) ) { features . addAll ( deps . getDependentFeatures ( mid ) ) ; } dependentFeatures = Collections . unmodifiableList ( Arrays . asList ( features . toArray ( new String [ features . size ( ) ] ) ) ) ; depFeatureListResource = createFeatureListResource ( dependentFeatures , getFeatureListResourceUri ( ) , deps . getLastModified ( ) ) ; generateModuleIdMap ( deps ) ; depsInitialized . countDown ( ) ; } catch ( ProcessingDependenciesException e ) { if ( log . isLoggable ( Level . WARNING ) ) { log . log ( Level . WARNING , e . getMessage ( ) , e ) ; } // Don ' t clear the latch as another call to this method can be expected soon
} catch ( Throwable t ) { if ( log . isLoggable ( Level . SEVERE ) ) { log . log ( Level . SEVERE , t . getMessage ( ) , t ) ; } // Clear the latch to allow the waiting thread to wake up . If
// dependencies have never been initialized , then NullPointerExceptions
// will be thrown for any threads trying to access the uninitialized
// dependencies .
depsInitialized . countDown ( ) ; }
|
public class ProgramChromosome { /** * Create a new chromosome from the given operation tree ( program ) .
* @ param program the operation tree
* @ param operations the allowed non - terminal operations
* @ param terminals the allowed terminal operations
* @ param < A > the operation type
* @ return a new chromosome from the given operation tree
* @ throws NullPointerException if one of the given arguments is { @ code null }
* @ throws IllegalArgumentException if the given operation tree is invalid ,
* which means there is at least one node where the operation arity
* and the node child count differ . */
public static < A > ProgramChromosome < A > of ( final Tree < ? extends Op < A > , ? > program , final ISeq < ? extends Op < A > > operations , final ISeq < ? extends Op < A > > terminals ) { } }
|
return of ( program , ( Predicate < ? super ProgramChromosome < A > > & Serializable ) ProgramChromosome :: isSuperValid , operations , terminals ) ;
|
public class AbstractDPMM { /** * Always use this method to get the cluster from the clusterMap because it
* ensures that the featureIds are set .
* The featureIds can be unset if we use a data structure which stores
* stuff in file . Since the featureIds field of cluster is transient , the
* information gets lost . This function ensures that it sets it back .
* @ param clusterId
* @ param clusterMap
* @ return */
private CL getFromClusterMap ( int clusterId , Map < Integer , CL > clusterMap ) { } }
|
CL c = clusterMap . get ( clusterId ) ; if ( c . getFeatureIds ( ) == null ) { c . setFeatureIds ( knowledgeBase . getModelParameters ( ) . getFeatureIds ( ) ) ; // fetch the featureIds from model parameters object
} return c ;
|
public class BoxRequestItemUpdate { /** * Returns the new description currently set for the item .
* @ return description for the item , or null if not set . */
public String getDescription ( ) { } }
|
return mBodyMap . containsKey ( BoxItem . FIELD_DESCRIPTION ) ? ( String ) mBodyMap . get ( BoxItem . FIELD_DESCRIPTION ) : null ;
|
public class ImmutableRoaringBitmap { /** * Computes AND between input bitmaps in the given range , from rangeStart ( inclusive ) to rangeEnd
* ( exclusive )
* @ param bitmaps input bitmaps , these are not modified
* @ param rangeStart inclusive beginning of range
* @ param rangeEnd exclusive ending of range
* @ return new result bitmap */
public static MutableRoaringBitmap and ( final Iterator < ? extends ImmutableRoaringBitmap > bitmaps , final long rangeStart , final long rangeEnd ) { } }
|
MutableRoaringBitmap . rangeSanityCheck ( rangeStart , rangeEnd ) ; Iterator < ImmutableRoaringBitmap > bitmapsIterator ; bitmapsIterator = selectRangeWithoutCopy ( bitmaps , rangeStart , rangeEnd ) ; return BufferFastAggregation . and ( bitmapsIterator ) ;
|
public class ResultSet { /** * Return List of Results . List is unmodifiable and only supports
* int get ( int index ) , int size ( ) , boolean isEmpty ( ) and Iterator < Result > iterator ( ) methods .
* Once called allResults ( ) , next ( ) method return null . Don ' t call next ( ) and allResults ( )
* together .
* @ return List of Results */
@ NonNull public List < Result > allResults ( ) { } }
|
final List < Result > results = new ArrayList < > ( ) ; Result result ; while ( ( result = next ( ) ) != null ) { results . add ( result ) ; } return results ;
|
public class DefaultJavascriptInvoker { /** * / * ( non - Javadoc )
* @ see minium . web . internal . drivers . Foo # invoke ( org . openqa . selenium . JavascriptExecutor , java . lang . String , java . lang . Object ) */
@ Override public < T > T invoke ( JavascriptExecutor wd , String expression , Object ... args ) { } }
|
return this . < T > doInvoke ( wd , expression , args ) ;
|
public class Sql { /** * A variant of { @ link # firstRow ( String , java . util . List ) }
* useful when providing the named parameters as named arguments .
* @ param params a map containing the named parameters
* @ param sql the SQL statement
* @ return a GroovyRowResult object or < code > null < / code > if no row is found
* @ throws SQLException if a database access error occurs
* @ since 1.8.7 */
public GroovyRowResult firstRow ( Map params , String sql ) throws SQLException { } }
|
return firstRow ( sql , singletonList ( params ) ) ;
|
public class Util { /** * reset bits at start , start + 1 , . . . , end - 1 and report the
* cardinality change
* @ param bitmap array of words to be modified
* @ param start first index to be modified ( inclusive )
* @ param end last index to be modified ( exclusive )
* @ return cardinality change */
@ Deprecated public static int resetBitmapRangeAndCardinalityChange ( long [ ] bitmap , int start , int end ) { } }
|
int cardbefore = cardinalityInBitmapWordRange ( bitmap , start , end ) ; resetBitmapRange ( bitmap , start , end ) ; int cardafter = cardinalityInBitmapWordRange ( bitmap , start , end ) ; return cardafter - cardbefore ;
|
public class InternalXbaseParser { /** * InternalXbase . g : 1342:1 : ruleXNumberLiteral : ( ( rule _ _ XNumberLiteral _ _ Group _ _ 0 ) ) ; */
public final void ruleXNumberLiteral ( ) throws RecognitionException { } }
|
int stackSize = keepStackSize ( ) ; try { // InternalXbase . g : 1346:2 : ( ( ( rule _ _ XNumberLiteral _ _ Group _ _ 0 ) ) )
// InternalXbase . g : 1347:2 : ( ( rule _ _ XNumberLiteral _ _ Group _ _ 0 ) )
{ // InternalXbase . g : 1347:2 : ( ( rule _ _ XNumberLiteral _ _ Group _ _ 0 ) )
// InternalXbase . g : 1348:3 : ( rule _ _ XNumberLiteral _ _ Group _ _ 0 )
{ if ( state . backtracking == 0 ) { before ( grammarAccess . getXNumberLiteralAccess ( ) . getGroup ( ) ) ; } // InternalXbase . g : 1349:3 : ( rule _ _ XNumberLiteral _ _ Group _ _ 0 )
// InternalXbase . g : 1349:4 : rule _ _ XNumberLiteral _ _ Group _ _ 0
{ pushFollow ( FOLLOW_2 ) ; rule__XNumberLiteral__Group__0 ( ) ; state . _fsp -- ; if ( state . failed ) return ; } if ( state . backtracking == 0 ) { after ( grammarAccess . getXNumberLiteralAccess ( ) . getGroup ( ) ) ; } } } } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; } finally { restoreStackSize ( stackSize ) ; } return ;
|
public class AsmClassGenerator { public void visitClass ( ClassNode classNode ) { } }
|
referencedClasses . clear ( ) ; WriterControllerFactory factory = classNode . getNodeMetaData ( WriterControllerFactory . class ) ; WriterController normalController = new WriterController ( ) ; if ( factory != null ) { this . controller = factory . makeController ( normalController ) ; } else { this . controller = normalController ; } this . controller . init ( this , context , cv , classNode ) ; this . cv = this . controller . getClassVisitor ( ) ; if ( controller . shouldOptimizeForInt ( ) || factory != null ) { OptimizingStatementWriter . setNodeMeta ( controller . getTypeChooser ( ) , classNode ) ; } try { int bytecodeVersion = controller . getBytecodeVersion ( ) ; Object min = classNode . getNodeMetaData ( MINIMUM_BYTECODE_VERSION ) ; if ( min instanceof Integer ) { int minVersion = ( int ) min ; if ( ( bytecodeVersion ^ Opcodes . V_PREVIEW ) < minVersion ) { bytecodeVersion = minVersion ; } } cv . visit ( bytecodeVersion , adjustedClassModifiersForClassWriting ( classNode ) , controller . getInternalClassName ( ) , BytecodeHelper . getGenericsSignature ( classNode ) , controller . getInternalBaseClassName ( ) , BytecodeHelper . getClassInternalNames ( classNode . getInterfaces ( ) ) ) ; cv . visitSource ( sourceFile , null ) ; if ( classNode instanceof InnerClassNode ) { InnerClassNode innerClass = ( InnerClassNode ) classNode ; MethodNode enclosingMethod = innerClass . getEnclosingMethod ( ) ; if ( enclosingMethod != null ) { String outerClassName = BytecodeHelper . getClassInternalName ( innerClass . getOuterClass ( ) . getName ( ) ) ; cv . visitOuterClass ( outerClassName , enclosingMethod . getName ( ) , BytecodeHelper . getMethodDescriptor ( enclosingMethod ) ) ; } } if ( classNode . getName ( ) . endsWith ( "package-info" ) ) { PackageNode packageNode = classNode . getPackage ( ) ; if ( packageNode != null ) { // pull them out of package node but treat them like they were on class node
visitAnnotations ( classNode , packageNode , cv ) ; } cv . visitEnd ( ) ; return ; } else { visitAnnotations ( classNode , cv ) ; } if ( classNode . isInterface ( ) ) { ClassNode owner = classNode ; if ( owner instanceof InnerClassNode ) { owner = owner . getOuterClass ( ) ; } String outerClassName = classNode . getName ( ) ; String name = outerClassName + "$" + context . getNextInnerClassIdx ( ) ; controller . setInterfaceClassLoadingClass ( new InterfaceHelperClassNode ( owner , name , ACC_SUPER | ACC_SYNTHETIC | ACC_STATIC , ClassHelper . OBJECT_TYPE , controller . getCallSiteWriter ( ) . getCallSites ( ) ) ) ; super . visitClass ( classNode ) ; createInterfaceSyntheticStaticFields ( ) ; } else { super . visitClass ( classNode ) ; MopWriter . Factory mopWriterFactory = classNode . getNodeMetaData ( MopWriter . Factory . class ) ; if ( mopWriterFactory == null ) { mopWriterFactory = MopWriter . FACTORY ; } MopWriter mopWriter = mopWriterFactory . create ( controller ) ; mopWriter . createMopMethods ( ) ; controller . getCallSiteWriter ( ) . generateCallSiteArray ( ) ; createSyntheticStaticFields ( ) ; } // GROOVY - 6750 and GROOVY - 6808
for ( Iterator < InnerClassNode > iter = classNode . getInnerClasses ( ) ; iter . hasNext ( ) ; ) { InnerClassNode innerClass = iter . next ( ) ; makeInnerClassEntry ( innerClass ) ; } makeInnerClassEntry ( classNode ) ; cv . visitEnd ( ) ; } catch ( GroovyRuntimeException e ) { e . setModule ( classNode . getModule ( ) ) ; throw e ; } catch ( NegativeArraySizeException nase ) { throw new GroovyRuntimeException ( "NegativeArraySizeException while processing " + sourceFile , nase ) ; } catch ( NullPointerException npe ) { throw new GroovyRuntimeException ( "NPE while processing " + sourceFile , npe ) ; }
|
public class FullscreenVideoView { /** * Restore the last State before seekTo ( )
* @ param mp the MediaPlayer that issued the seek operation */
@ Override public void onSeekComplete ( MediaPlayer mp ) { } }
|
Log . d ( TAG , "onSeekComplete" ) ; stopLoading ( ) ; if ( lastState != null ) { switch ( lastState ) { case STARTED : { start ( ) ; break ; } case PLAYBACKCOMPLETED : { currentState = State . PLAYBACKCOMPLETED ; break ; } case PREPARED : { currentState = State . PREPARED ; break ; } } } if ( this . seekCompleteListener != null ) this . seekCompleteListener . onSeekComplete ( mp ) ;
|
public class NativeIO { /** * Call ioprio _ set ( class , data ) for this thread .
* @ throws NativeIOException
* if there is an error with the syscall */
public static void ioprioSetIfPossible ( int classOfService , int data ) throws IOException { } }
|
if ( nativeLoaded && ioprioPossible ) { if ( classOfService == IOPRIO_CLASS_NONE ) { // ioprio is disabled .
return ; } try { ioprio_set ( classOfService , data ) ; } catch ( UnsupportedOperationException uoe ) { LOG . warn ( "ioprioSetIfPossible() failed" , uoe ) ; ioprioPossible = false ; } catch ( UnsatisfiedLinkError ule ) { LOG . warn ( "ioprioSetIfPossible() failed" , ule ) ; ioprioPossible = false ; } catch ( NativeIOException nie ) { LOG . warn ( "ioprioSetIfPossible() failed" , nie ) ; throw nie ; } }
|
public class CDIInterceptorManagedObjectFactoryImpl { /** * { @ inheritDoc } We need to override this so that a special interceptor instance was created instead of the common proxied one */
@ Override protected InjectionTarget < T > getInjectionTarget ( boolean nonContextual ) { } }
|
InjectionTarget < T > injectionTarget = null ; Class < T > clazz = getManagedObjectClass ( ) ; WebSphereBeanDeploymentArchive bda = getCurrentBeanDeploymentArchive ( ) ; if ( bda != null ) { injectionTarget = bda . getJEEComponentInjectionTarget ( clazz ) ; } if ( injectionTarget == null ) { AnnotatedType < T > annotatedType = getAnnotatedType ( clazz , nonContextual ) ; WeldInjectionTargetFactory < T > weldInjectionTargetFactory = getBeanManager ( ) . getInjectionTargetFactory ( annotatedType ) ; injectionTarget = weldInjectionTargetFactory . createInterceptorInjectionTarget ( ) ; if ( bda != null ) { bda . addJEEComponentInjectionTarget ( clazz , injectionTarget ) ; } } return injectionTarget ;
|
public class WorkerNetAddress { /** * < code > optional string host = 1 ; < / code > */
public java . lang . String getHost ( ) { } }
|
java . lang . Object ref = host_ ; if ( ref instanceof java . lang . String ) { return ( java . lang . String ) ref ; } else { com . google . protobuf . ByteString bs = ( com . google . protobuf . ByteString ) ref ; java . lang . String s = bs . toStringUtf8 ( ) ; if ( bs . isValidUtf8 ( ) ) { host_ = s ; } return s ; }
|
public class FluentIterable { /** * Returns a fluent iterable whose iterators traverse first the elements of this fluent iterable ,
* followed by { @ code elements } .
* @ since 18.0 */
@ Beta @ CheckReturnValue public final FluentIterable < E > append ( E ... elements ) { } }
|
return from ( Iterables . concat ( iterable , Arrays . asList ( elements ) ) ) ;
|
public class KAFDocument { /** * Creates a new category . It assigns an appropriate ID to it . The category is added to the document .
* @ param lemma the lemma of the category .
* @ param references different mentions ( list of targets ) to the same category .
* @ return a new coreference . */
public Feature newCategory ( String lemma , List < Span < Term > > references ) { } }
|
String newId = idManager . getNextId ( AnnotationType . CATEGORY ) ; Feature newCategory = new Feature ( newId , lemma , references ) ; annotationContainer . add ( newCategory , Layer . CATEGORIES , AnnotationType . CATEGORY ) ; return newCategory ;
|
public class JLSValidator { /** * Validates whether the < code > className < / code > parameter is a valid class name . This method verifies both qualified
* and unqualified class names .
* @ param className
* @ return */
public static ValidationResult validateClassName ( String className ) { } }
|
if ( Strings . isNullOrEmpty ( className ) ) return new ValidationResult ( ERROR , Messages . notNullOrEmpty ( CLASS_NAME ) ) ; int indexOfDot = className . lastIndexOf ( "." ) ; if ( indexOfDot == - 1 ) { return validateIdentifier ( className , CLASS_NAME ) ; } else { String packageSequence = className . substring ( 0 , indexOfDot ) ; ValidationResult result = validatePackageName ( packageSequence ) ; if ( ! result . getType ( ) . equals ( ResultType . INFO ) ) { return result ; } String classSequence = className . substring ( indexOfDot + 1 ) ; return validateIdentifier ( classSequence , CLASS_NAME ) ; }
|
public class CleaneLingSolver { /** * Adds a clause to a literal ' s occurrence list .
* @ param lit the literal
* @ param c the clause */
private void addOcc ( final int lit , final CLClause c ) { } }
|
assert this . dense ; occs ( lit ) . add ( c ) ; touch ( lit ) ;
|
public class ThrowableUtils { /** * Determines the original , root cause of the given { @ link Throwable } object .
* @ param throwable { @ link Throwable } object who ' s root cause will be determined .
* @ return a { @ link Throwable } object indicating the root cause of the given { @ link Throwable } object ,
* or { @ literal null } if the { @ link Throwable } object reference is { @ literal null } .
* @ see java . lang . Throwable # getCause ( ) */
@ NullSafe @ SuppressWarnings ( "all" ) public static Throwable getRootCause ( Throwable throwable ) { } }
|
while ( getCause ( throwable ) != null ) { throwable = throwable . getCause ( ) ; } return throwable ;
|
public class EnforcementJobRest { /** * Get the list of available enforcements
* < pre >
* GET / enforcements
* Request :
* GET / enforcements HTTP / 1.1
* Accept : application / xml
* Response :
* { @ code
* < ? xml version = " 1.0 " encoding = " UTF - 8 " ? >
* < collection href = " / enforcements " >
* < items offset = " 0 " total = " 1 " >
* < enforcement _ job >
* < agreement _ id > agreement04 < / agreement _ id >
* < enabled > false < / enabled >
* < / enforcement _ job >
* < / items >
* < / collection >
* < / pre >
* Example : < li > curl http : / / localhost : 8080 / sla - service / enforcements < / li >
* @ return XML information with the different details of the different
* enforcements
* @ throws Exception */
@ GET @ Produces ( MediaType . APPLICATION_XML ) public Response getEnforcements ( ) { } }
|
logger . debug ( "StartOf getEnforcements - REQUEST for /enforcements" ) ; EnforcementJobHelper enforcementJobService = getHelper ( ) ; String serializedEnforcements = null ; try { serializedEnforcements = enforcementJobService . getEnforcements ( ) ; } catch ( HelperException e ) { logger . info ( "getEnforcements exception:" + e . getMessage ( ) ) ; return buildResponse ( e ) ; } logger . debug ( "EndOf getEnforcements" ) ; return buildResponse ( 200 , serializedEnforcements ) ;
|
public class MasterStorableGenerator { /** * Sets the version property to its initial uninitialized state . */
private void unsetVersionProperty ( CodeBuilder b ) throws SupportException { } }
|
StorableProperty < ? > property = mInfo . getVersionProperty ( ) ; // Set the property state to uninitialized .
{ String stateFieldName = StorableGenerator . PROPERTY_STATE_FIELD_NAME + ( property . getNumber ( ) >> 4 ) ; b . loadThis ( ) ; b . loadThis ( ) ; b . loadField ( stateFieldName , TypeDesc . INT ) ; int shift = ( property . getNumber ( ) & 0xf ) * 2 ; b . loadConstant ( ~ ( StorableGenerator . PROPERTY_STATE_MASK << shift ) ) ; b . math ( Opcode . IAND ) ; b . storeField ( stateFieldName , TypeDesc . INT ) ; } // Zero the property value .
TypeDesc type = TypeDesc . forClass ( property . getType ( ) ) ; b . loadThis ( ) ; CodeBuilderUtil . blankValue ( b , type ) ; b . storeField ( property . getName ( ) , type ) ;
|
public class FastCopy { /** * Performs a fast copy of the src file to the destination file . This method
* tries to copy the blocks of the source file on the same local machine and
* then stitch up the blocks to build the new destination file
* @ param src
* the source file , this should be the full HDFS URI
* @ param destination
* the destination file , this should be the full HDFS URI
* @ return CopyResult
* the operation is successful , or not . */
public CopyResult copy ( String src , String destination , DistributedFileSystem srcFs , DistributedFileSystem dstFs , Reporter reporter ) throws Exception { } }
|
Callable < CopyResult > fastFileCopy = new FastFileCopy ( src , destination , srcFs , dstFs , reporter ) ; Future < CopyResult > f = executor . submit ( fastFileCopy ) ; return f . get ( ) ;
|
public class JcrNodeTypeManager { /** * Unregisters the named node type if it is not referenced by other node types as a supertype , a default primary type of a
* child node ( or nodes ) , or a required primary type of a child node ( or nodes ) .
* @ param nodeTypeName
* @ throws NoSuchNodeTypeException if node type name does not correspond to a registered node type
* @ throws InvalidNodeTypeDefinitionException if the node type with the given name cannot be unregistered because it is the
* supertype , one of the required primary types , or a default primary type of another node type
* @ throws AccessDeniedException if the current session does not have the { @ link ModeShapePermissions # REGISTER _ TYPE register
* type permission } .
* @ throws RepositoryException if any other error occurs */
@ Override public void unregisterNodeType ( String nodeTypeName ) throws NoSuchNodeTypeException , InvalidNodeTypeDefinitionException , RepositoryException { } }
|
unregisterNodeTypes ( Collections . singleton ( nodeTypeName ) ) ;
|
public class StorageSnippets { /** * [ VARIABLE " my _ blob _ name2 " ] */
public List < Blob > batchGet ( String bucketName , String blobName1 , String blobName2 ) { } }
|
// [ START batchGet ]
BlobId firstBlob = BlobId . of ( bucketName , blobName1 ) ; BlobId secondBlob = BlobId . of ( bucketName , blobName2 ) ; List < Blob > blobs = storage . get ( firstBlob , secondBlob ) ; // [ END batchGet ]
return blobs ;
|
public class TocTreeBuilder { /** * Add a { @ link ListItemBlock } in the current toc tree block and return the new { @ link ListItemBlock } .
* @ param currentBlock the current block in the toc tree .
* @ param headerBlock the { @ link HeaderBlock } to use to generate toc anchor label .
* @ return the new { @ link ListItemBlock } . */
private Block addItemBlock ( Block currentBlock , HeaderBlock headerBlock , String documentReference ) { } }
|
ListItemBlock itemBlock = headerBlock == null ? createEmptyTocEntry ( ) : createTocEntry ( headerBlock , documentReference ) ; currentBlock . addChild ( itemBlock ) ; return itemBlock ;
|
public class RunRemoteProcessMessageData { /** * Init Method . */
public void init ( MessageDataParent messageDataParent , String strKey ) { } }
|
if ( strKey == null ) strKey = RUN_REMOTE_PROCESS ; super . init ( messageDataParent , strKey ) ;
|
public class FtpMessage { /** * Gets the command args . */
public String getArguments ( ) { } }
|
return Optional . ofNullable ( getHeader ( FtpMessageHeaders . FTP_ARGS ) ) . map ( Object :: toString ) . orElse ( null ) ;
|
public class LoaderUtil { /** * Finds classpath { @ linkplain URL resources } .
* @ param resource the name of the resource to find .
* @ return a Collection of URLs matching the resource name . If no resources could be found , then this will be empty .
* @ since 2.1 */
public static Collection < URL > findResources ( final String resource ) { } }
|
final Collection < UrlResource > urlResources = findUrlResources ( resource ) ; final Collection < URL > resources = new LinkedHashSet < > ( urlResources . size ( ) ) ; for ( final UrlResource urlResource : urlResources ) { resources . add ( urlResource . getUrl ( ) ) ; } return resources ;
|
public class CommerceUserSegmentEntryLocalServiceUtil { /** * Adds the commerce user segment entry to the database . Also notifies the appropriate model listeners .
* @ param commerceUserSegmentEntry the commerce user segment entry
* @ return the commerce user segment entry that was added */
public static com . liferay . commerce . user . segment . model . CommerceUserSegmentEntry addCommerceUserSegmentEntry ( com . liferay . commerce . user . segment . model . CommerceUserSegmentEntry commerceUserSegmentEntry ) { } }
|
return getService ( ) . addCommerceUserSegmentEntry ( commerceUserSegmentEntry ) ;
|
public class BeanUtil { /** * TODO : Rename to invokeStatic ? */
public static Object invokeStaticMethod ( Class < ? > pClass , String pMethod , Object ... pParams ) throws InvocationTargetException { } }
|
Object value = null ; try { // Create param and argument arrays
Class [ ] paramTypes = new Class [ pParams . length ] ; for ( int i = 0 ; i < pParams . length ; i ++ ) { paramTypes [ i ] = pParams [ i ] . getClass ( ) ; } // Get method
// * * * If more than one such method is found in the class , and one
// of these methods has a RETURN TYPE that is more specific than
// any of the others , that method is reflected ; otherwise one of
// the methods is chosen ARBITRARILY .
// java / lang / Class . html # getMethod ( java . lang . String , java . lang . Class [ ] )
Method method = pClass . getMethod ( pMethod , paramTypes ) ; // Invoke public static method
if ( Modifier . isPublic ( method . getModifiers ( ) ) && Modifier . isStatic ( method . getModifiers ( ) ) ) { value = method . invoke ( null , pParams ) ; } } /* All this to let InvocationTargetException pass on */
catch ( NoSuchMethodException nsme ) { return null ; } catch ( IllegalAccessException iae ) { return null ; } catch ( IllegalArgumentException iarge ) { return null ; } return value ;
|
public class LookupManagerImpl { /** * { @ inheritDoc } */
@ Override public ServiceInstance queryInstanceByMetadataKey ( ServiceInstanceQuery query ) throws ServiceException { } }
|
ServiceInstanceUtils . validateManagerIsStarted ( isStarted . get ( ) ) ; validateServiceInstanceMetadataQuery ( query ) ; ServiceInstanceLoadBalancer lb = lbManager . getDefaultLoadBalancer ( ) ; return lb . vote ( queryInstancesByMetadataKey ( query ) ) ;
|
public class EJSContainer { /** * Introduced this postInvoke ( EJSWrapperBase . . . ) for Local Interface support .
* The old postInvoke ( EJSWrapper . . . ) must still be support for backward
* compatible with old generated code base . */
public void postInvoke ( EJSWrapperBase wrapper , int methodId , EJSDeployedSupport s ) throws RemoteException { } }
|
// LIDB2775-23.1
DispatchEventListenerCookie [ ] dispatchEventListenerCookies = null ; // @ MD16426A
EJBMethodInfoImpl methodInfo = s . methodInfo ; // d114406 d154342.4 d173022
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; // d532639.2
// If this is a stateless SessionBean create , run only the bare minimum of
// collaborators and other processing . This path is encapsulated in a separate
// method for now , to avoid lots of " if " statements within this method .
if ( methodInfo . isStatelessSessionBean && methodInfo . isHomeCreate ) { EjbPostInvokeForStatelessCreate ( wrapper , methodId , s ) ; } else { if ( isTraceOn ) { if ( TEEJBInvocationInfo . isTraceEnabled ( ) ) TEEJBInvocationInfo . tracePostInvokeBegins ( s , wrapper ) ; // d161864
if ( tcClntInfo . isDebugEnabled ( ) ) Tr . debug ( tcClntInfo , "postInvoke(" + methodInfo . getMethodName ( ) + ")" ) ; if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "EJBpostInvoke(" + methodId + ":" + methodInfo . getMethodName ( ) + ")" ) ; } EJBThreadData threadData = s . ivThreadData ; // d646139.1
BeanId beanId = wrapper . beanId ; BeanO beanO = null ; BeanMetaData bmd = null ; // 92702
// UOWManager . runUnderUOW may have left cached currentTx invalid ; reset
if ( s . resetCurrentTx ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "s.currentTx may be invalid; reset" ) ; s . currentTx = getCurrentContainerTx ( ) ; } // LIDB2775-23.1
// Do SMF after method recording - / / MD16426A - begin
if ( isZOS ) { dispatchEventListenerCookies = s . ivDispatchEventListenerCookies ; if ( dispatchEventListenerCookies != null ) { // notify event dispatch listeners -
// Note : It is important that the ' afterEjbMethod ' notification
// occur as the first event during postInvoke so that this
// signal is delivered as close as possible to the actual return
// from the bean method invocation .
this . ivDispatchEventListenerManager . callDispatchEventListeners ( DispatchEventListener . AFTER_EJBMETHOD , dispatchEventListenerCookies , methodInfo ) ; // @ MD16426A
} // @ MD16426A
} try { beanO = s . beanO ; // d140003.19
if ( s . exType != ExceptionType . NO_EXCEPTION ) { // d113344 / / d140003.19
// 87918.8(2)
if ( s . exType == ExceptionType . CHECKED_EXCEPTION ) { // d113344 / / d140003.19
if ( isTraceOn && tc . isEventEnabled ( ) ) Tr . event ( tc , "Bean method threw exception" , s . getException ( ) ) ; // d140003.19
} else if ( s . exType == ExceptionType . UNCHECKED_EXCEPTION ) { if ( isTraceOn && tc . isEventEnabled ( ) ) Tr . event ( tc , "Bean method threw unchecked exception" , s . getException ( ) ) ; // d140003.19
// d113344
if ( beanO != null && s . preInvokeException == false ) { // This indicates unchecked exception came from the business
// method itself , so we want to discard the bean instance .
beanO . discard ( ) ; } if ( isTraceOn && tc . isEventEnabled ( ) ) Tr . event ( tc , "Bean Discarded as non null" ) ; } } // 89188
// bmd = ( BeanMetaData ) internalBeanMetaDataStore . get ( wrapper . beanId . getJ2EEName ( ) ) ; / / 89554
// d110126
// Optimizations to preInvoke / postInvoke processing :
// Created specialized case for stateless SessionBean creation
// BeanMetaData no longer looked up via hashtable , is now stored in the EJSWrapper
// Removed extraneous call to TxCntl . getCurrentTransaction ( dead code )
bmd = wrapper . bmd ; // d110126
// end 89188
// Call postInvoke on all of the BeforeActivation Collaborators
// that were successfully preInvoked . Note that the order is the
// same as preInvoke . Note the ComponentMetaDataCollaborator is
// no longer in this list ; see below . d228192 LI3795-56
if ( ivBeforeActivationCollaborators != null ) { for ( int i = 0 ; i < s . ivBeforeActivationPreInvoked ; i ++ ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "postInvoke : Invoking BeforeActivationCollaborator.postInvoke method on: " + ivBeforeActivationCollaborators [ i ] . getClass ( ) . getName ( ) ) ; Object cookie = s . ivBeforeActivationCookies == null ? null : s . ivBeforeActivationCookies [ i ] ; // F61004.3
notifyPostInvoke ( ivBeforeActivationCollaborators [ i ] , s , cookie ) ; } } // Call postInvoke on all of the AfterActivation Collaborators
// that were successfully preInvoked . Note that the order is the
// same as preInvoke . d228192
if ( ivAfterActivationCollaborators != null ) { for ( int i = 0 ; i < s . ivAfterActivationPreInvoked ; i ++ ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "postInvoke : Invoking AfterActivationCollaborator.postInvoke method on: " + ivAfterActivationCollaborators [ i ] . getClass ( ) . getName ( ) ) ; Object cookie = s . ivAfterActivationCookies == null ? null : s . ivAfterActivationCookies [ i ] ; // F61004.3
notifyPostInvoke ( ivAfterActivationCollaborators [ i ] , s , cookie ) ; } } if ( beanO != null ) { beanO . postInvoke ( methodId , s ) ; } } catch ( RemoteException ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".postInvoke" , "2268" , new Object [ ] { this , wrapper , Integer . valueOf ( methodId ) , s } ) ; // 123338
if ( isTraceOn && tc . isEventEnabled ( ) ) Tr . event ( tc , "postInvoke failed" , ex ) ; throw ex ; } catch ( Throwable ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".postInvoke" , "2273" , new Object [ ] { this , wrapper , Integer . valueOf ( methodId ) , s } ) ; // 123338
if ( isTraceOn && tc . isEventEnabled ( ) ) Tr . event ( tc , "postInvoke failed" , ex ) ; s . setUncheckedException ( ex ) ; // d117817
} finally { // LIDB2775-23.1
if ( isZOS && dispatchEventListenerCookies != null ) { // Before transaction context changes , do SMF end dispatch recording
this . ivDispatchEventListenerManager . callDispatchEventListeners ( DispatchEventListener . END_DISPATCH , dispatchEventListenerCookies , methodInfo ) ; // @ MD16426A
} final ContainerTx currentTx = s . currentTx ; // d140003.19
try { if ( beanO != null ) { activator . postInvoke ( currentTx , beanO ) ; } if ( currentTx != null ) { currentTx . postInvoke ( s ) ; } if ( s . uowCtrlPreInvoked ) { if ( s . began && currentTx != null && currentTx . ivPostInvokeContext == null ) { // Indicate that afterCompletion should call
// postInvokePopCallbackContexts . RTC107108
// Don ' t do see if this is a nested EJB call from
// beforeCompletion . RTC115108
currentTx . ivPostInvokeContext = s ; } uowCtrl . postInvoke ( beanId , s . uowCookie , s . exType , methodInfo ) ; // d113344 / / d140003.19
} // Since ' Lightweight ' methods may not be executing the
// Transaction Collaborator , the postInvoke processing must
// be done here . LI3795-56
else if ( methodInfo . isLightweightTxCapable && s . currentTx != null ) { if ( s . isLightweight ) { if ( s . exType == ExceptionType . UNCHECKED_EXCEPTION ) { // In this scenario , there is always an inherited global
// transaction , and the correct action for all Tx
// Strategies is to mark the tx as rollbackonly and throw
// the CSITransactionRolledbackException , forcing the
// catch block below .
if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Lightweight:handleException - rollback" ) ; uowCtrl . setRollbackOnly ( ) ; throw new CSITransactionRolledbackException ( "Unexpected Exception from Lightweight EJB method" ) ; } } else if ( beanO != null && bmd . type == InternalConstants . TYPE_STATEFUL_SESSION ) { // Simulate transaction commit for the bean . We do not
// need to call ContainerTx . delist because we avoided
// ContainerTx . enlist during activation . F61004.1
beanO . beforeCompletion ( ) ; simulateCommitBean ( beanO , currentTx ) ; } } // If a remove method was invoked , and the bean instance was
// NOT removed during afterCompletion , then the transaction
// did not commit . . and thus a RemoveException should be
// thrown . Stateful beans may NOT be removed while still
// enlisted in a transaction . The RemoveException will be
// wrapped in the appropriate exception , as it is generally
// not on the throws clause for @ Remove methods . 390657
if ( currentTx != null && currentTx . ivRemoveBeanO != null ) { // Per a SUN ( CTS ) clarification , not removing a SF bean
// in a transaction will only be enforced for Bean Managed
// beans , since the UserTx is ' sticky ' and would be
// orphanded if the bean were removed . d451675
if ( bmd . usesBeanManagedTx || bmd . usesBeanManagedAS ) { currentTx . ivRemoveBeanO = null ; throw new RemoveException ( "Cannot remove stateful session bean " + "within a transaction." ) ; } else { // For the CMT case , the bean will just be removed from
// the transaction and removed . . without calling the
// synchronization methods . The following will transition
// the bean to the correct state , and remove from the
// EJB Cache . . . deleting the bean . d451675
// d666718 - Delist the bean from the transaction .
// Otherwise , we will try to perform redundant processing
// on it later when the transaction actually completes .
try { currentTx . delist ( beanO ) ; } catch ( TransactionRolledbackException ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".postInvoke" , "4641" , this ) ; if ( isTraceOn && tc . isEventEnabled ( ) ) Tr . event ( tc , "Exception thrown from ContainerTx.delist()" , new Object [ ] { beanO , ex } ) ; } simulateCommitBean ( beanO , currentTx ) ; } } } catch ( CSITransactionRolledbackException ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".postInvoke" , "2326" , new Object [ ] { this , wrapper , Integer . valueOf ( methodId ) , s } ) ; // 123338
postInvokeRolledbackException ( s , ex ) ; } catch ( Throwable t ) { FFDCFilter . processException ( t , CLASS_NAME + ".postInvoke" , "2366" , this ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "postInvoke: Exception in finally clause. An unexpected case" , t ) ; if ( s . exType == ExceptionType . NO_EXCEPTION ) { // PQ94124
// An unexpected exception has occured in post processing ,
// that the application is unaware of .
// call setUnCheckedEx and throw an exception .
s . setUncheckedException ( t ) ; // d117817
// s . setUncheckedException throws either runtime ( for local I / F ) or
// remote exception .
} } finally { // Bean - specific contexts need to be present for beforeCompletion
// for JPA @ PreUpdate , so we cannot pop the contexts prior to
// transaction completion , but ContainerTx . afterCompletion unpins
// beans from the current transaction , which would leave " stale "
// contexts in place for subsequent afterCompletion callbacks ,
// so ContainerTx . afterCompletion pops contexts . However , we
// need to pop contexts ourselves if there was no transaction , or
// the transaction wasn ' t committed ( because this method didn ' t
// begin it or it was a sticky BMT ) , or the transaction was
// committed but ContainerTx . afterCompletion wasn ' t called due to
// some fatal error in transactions . RTC107108
if ( currentTx == null ) { postInvokePopCallbackContexts ( s ) ; } else if ( ! s . began || currentTx . ivPostInvokeContext != null ) { postInvokePopCallbackContexts ( s ) ; // Reset the indicator so that sticky BMT doesn ' t pop the
// callback context in the middle of a bean method , but only
// do so if we set the method context above ( don ' t do so if
// this is a nested EJB call from beforeCompletion ) . RTC115108
if ( currentTx . ivPostInvokeContext == s ) { currentTx . ivPostInvokeContext = null ; } } // Pmi instrumentation for methods in beans
// Use pmiBean cached in the wrapper . d140003.33
// Insure this is done even if an exception is thrown . d623908
EJBPMICollaborator pmiBean = wrapper . ivPmiBean ; // d174057.2
if ( pmiBean != null && s . pmiPreInvoked ) { pmiBean . methodPostInvoke ( wrapper . beanId , methodInfo , s . pmiCookie ) ; if ( methodInfo . isHomeCreate ( ) ) { // d647928 - SFSB and entity creation always goes through
// home wrappers . The other bean types have code in
// EJSHome for create time .
if ( bmd . isStatefulSessionBean ( ) || bmd . isEntityBean ( ) ) { pmiBean . finalTime ( EJBPMICollaborator . CREATE_RT , s . pmiCookie ) ; } } else if ( methodInfo . isComponentRemove ( ) ) { // d647928 - SFSB and entity can both be removed via the
// remove method on the wrapper . That method is a no - op
// for the other bean types .
if ( bmd . isStatefulSessionBean ( ) || bmd . isEntityBean ( ) ) { pmiBean . finalTime ( EJBPMICollaborator . REMOVE_RT , s . pmiCookie ) ; } } } // PQ74774 Begins
if ( s . ivSecurityCollaborator != null ) { notifyPostInvoke ( s . ivSecurityCollaborator , s , s . securityCookie ) ; } // PQ74774 Ends
// 92702 - BAAC collaborators must be called last of all
// the only example we know of is the JNS collaborator
if ( ivBeforeActivationAfterCompletionCollaborators != null ) { // Call postInvoke on all of the BeforeActivationAfterCompletion
// Collaborators that were successfully preInvoked . Note that
// the order is the same as preInvoke . d228192
for ( int i = 0 ; i < s . ivBeforeActivationAfterCompletionPreInvoked ; i ++ ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "postInokve : Invoking BeforeActivationAfterCompletionCollaborator.postInvoke method on: " + ivBeforeActivationAfterCompletionCollaborators [ i ] . getClass ( ) . getName ( ) ) ; Object cookie = s . ivBeforeActivationAfterCompletionCookies == null ? null : s . ivBeforeActivationAfterCompletionCookies [ i ] ; // F61004.3
notifyPostInvoke ( ivBeforeActivationAfterCompletionCollaborators [ i ] , s , cookie ) ; } } // Inform EJB method callback that method has completed . This must be
// called after the transaction has completed .
if ( s . ivEJBMethodCallback != null ) { // hmmmm , what if exception occurs ? Same problem as if beforeActivationAfterCompletion
// collaborators throw an exception prior to this change .
s . invocationCallbackPostInvoke ( ) ; // d194342.1.1
} // drop the reference on the wrapper
// Not required if the wrapper has already been removed
if ( s . unpinOnPostInvoke ) // d140003.19
wrapperManager . postInvoke ( wrapper ) ; // If preInvoke began the transaction , then the ContainerTx
// is no longer in use , and so may be cleared , so just call
// releaseResources ( ) to clear all of the fields . . . making garbage
// collection eaiser , and allows things to be garbage collected
// even if some other object ( like PM ) holds a reference to the
// ContainerTx for awhile . d154342.10 d156606
// Note that ' began ' for the ContainerTx is not valid at this
// point , since the postInvoke call on it restored the ' began '
// setting to the previous method state , so use the ' began ' flag
// in EJSDeployedSupport ( valid for current method ) . d156688
if ( s . currentTx != null && s . began ) { s . currentTx . releaseResources ( ) ; // d215317
s . currentTx = null ; } // 112678.6 d115602-1
if ( methodInfo . setClassLoader ) { EJBThreadData . svThreadContextAccessor . popContextClassLoaderForUnprivileged ( s . oldClassLoader ) ; } else { threadData . popORBWrapperClassLoader ( ) ; } // 92682
threadData . popMethodContext ( ) ; // d646139.1 , RTC102449
// d161864 Begins
if ( isTraceOn ) { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "EJBpostInvoke(" + methodId + ":" + methodInfo . getMethodName ( ) + ")" + ( ( s . ivException != null ) ? ( "**** throws " + s . ivException ) : "" ) ) ; if ( TEEJBInvocationInfo . isTraceEnabled ( ) ) { if ( s . ivException == null ) { TEEJBInvocationInfo . tracePostInvokeEnds ( s , wrapper ) ; } else { TEEJBInvocationInfo . tracePostInvokeException ( s , wrapper , s . ivException ) ; } } } // d161864 Ends
} // end 92702
} }
|
public class DiskLruCache { /** * Drops the entry for { @ code key } if it exists and can be removed . Entries
* actively being edited cannot be removed .
* @ return true if an entry was removed . */
public synchronized boolean remove ( String key ) throws IOException { } }
|
checkNotClosed ( ) ; validateKey ( key ) ; Entry entry = lruEntries . get ( key ) ; if ( entry == null || entry . currentEditor != null ) { return false ; } for ( int i = 0 ; i < valueCount ; i ++ ) { File file = entry . getCleanFile ( i ) ; if ( file . exists ( ) && ! file . delete ( ) ) { throw new IOException ( "failed to delete " + file ) ; } size -= entry . lengths [ i ] ; fileCount -- ; entry . lengths [ i ] = 0 ; } redundantOpCount ++ ; journalWriter . append ( REMOVE + ' ' + key + '\n' ) ; lruEntries . remove ( key ) ; if ( journalRebuildRequired ( ) ) { executorService . submit ( cleanupCallable ) ; } return true ;
|
public class DerivedQueryCreator { /** * Determines whether the case for a Part should be ignored based on property type and IgnoreCase keywords in the
* method name
* @ param part
* @ return */
private boolean shouldIgnoreCase ( final Part part ) { } }
|
final Class < ? > propertyClass = part . getProperty ( ) . getLeafProperty ( ) . getType ( ) ; final boolean isLowerable = String . class . isAssignableFrom ( propertyClass ) ; final boolean shouldIgnoreCase = part . shouldIgnoreCase ( ) != Part . IgnoreCaseType . NEVER && isLowerable && ! UNSUPPORTED_IGNORE_CASE . contains ( part . getType ( ) ) ; if ( part . shouldIgnoreCase ( ) == Part . IgnoreCaseType . ALWAYS && ( ! isLowerable || UNSUPPORTED_IGNORE_CASE . contains ( part . getType ( ) ) ) ) { LOGGER . debug ( "Ignoring case for \"{}\" type is meaningless" , propertyClass ) ; } return shouldIgnoreCase ;
|
public class ManagedProcess { private String getProcShortName ( ) { } }
|
// could later be extended to some sort of fake numeric PID , e . g . " mysqld - 1 " , from a static
// Map < String execName , Integer id )
if ( procShortName == null ) { File exec = getExecutableFile ( ) ; procShortName = exec . getName ( ) ; } return procShortName ;
|
public class KodoClient { /** * Copys object in Qiniu kodo .
* @ param src source Object key
* @ param dst destination Object Key */
public void copyObject ( String src , String dst ) throws QiniuException { } }
|
mBucketManager . copy ( mBucketName , src , mBucketName , dst ) ;
|
public class HttpUtils { /** * Check for a conditional operation .
* @ param ifMatch the If - Match header
* @ param etag the resource etag */
public static void checkIfMatch ( final String ifMatch , final EntityTag etag ) { } }
|
if ( ifMatch == null ) { return ; } final Set < String > items = stream ( ifMatch . split ( "," ) ) . map ( String :: trim ) . collect ( toSet ( ) ) ; if ( items . contains ( "*" ) ) { return ; } try { if ( etag . isWeak ( ) || items . stream ( ) . map ( EntityTag :: valueOf ) . noneMatch ( isEqual ( etag ) ) ) { throw new ClientErrorException ( status ( PRECONDITION_FAILED ) . build ( ) ) ; } } catch ( final IllegalArgumentException ex ) { throw new BadRequestException ( ex ) ; }
|
public class Element { /** * Selects the Nth option from the element , starting from 0 , but only if the
* element is present , displayed , enabled , and an input . If those conditions
* are not met , the select action will be logged , but skipped and the test
* will continue .
* @ param index - the select option to be selected - note , row numbering
* starts at 0 */
public void select ( int index ) { } }
|
String action = SELECTING + index + " in " + prettyOutput ( ) ; String expected = prettyOutputStart ( ) + PRESENT_DISPLAYED_AND_ENABLED + index + SELECTED ; try { if ( isNotPresentDisplayedEnabledSelect ( action , expected ) ) { return ; } String [ ] options = get . selectOptions ( ) ; if ( index > options . length ) { reporter . fail ( action , expected , "Unable to select the <i>" + index + "</i> option, as there are only <i>" + options . length + "</i> available." ) ; return ; } // do the select
WebElement webElement = getWebElement ( ) ; Select dropdown = new Select ( webElement ) ; dropdown . selectByIndex ( index ) ; } catch ( Exception e ) { log . warn ( e ) ; reporter . fail ( action , expected , CANT_SELECT + prettyOutputEnd ( ) + e . getMessage ( ) ) ; return ; } reporter . pass ( action , expected , "Selected option <b>" + index + INN + prettyOutputEnd ( ) . trim ( ) ) ;
|
public class ByteBuffers { /** * Fills data from position to limit with zeroes . Doesn ' t change position .
* @ param bb */
public static final void clearRemaining ( ByteBuffer bb ) { } }
|
if ( bb . hasArray ( ) ) { Arrays . fill ( bb . array ( ) , bb . arrayOffset ( ) + bb . position ( ) , bb . arrayOffset ( ) + bb . limit ( ) , ( byte ) 0 ) ; } else { int limit = bb . limit ( ) ; for ( int ii = bb . position ( ) ; ii < limit ; ii ++ ) { bb . put ( ii , ( byte ) 0 ) ; } }
|
public class SasUtils { /** * Serialize secret share to binary message format . The message consists of the following fields :
* < ul >
* < li > header ( ASCII string " SS " ) < / li >
* < li > single byte indicating the ordinal number of this specific share in the series < / li >
* < li > single integer ( four bytes ) indicating the length of the share data < / li >
* < li > variable number of bytes ( see previous item ) representing share data < / li >
* < li > single integer ( four bytes ) indicating the length of the prime data < / li >
* < li > variable number of bytes ( see previous item ) representing prime data < / li >
* < / ul >
* @ param share secret share to serialize
* @ return byte array representing serialized secret share */
public static byte [ ] encodeToBinary ( SecretShare share ) { } }
|
if ( share . getN ( ) < 0 || share . getN ( ) > 255 ) { throw new IllegalArgumentException ( "Invalid share number, must be between 0 and 255" ) ; } byte [ ] shareData = share . getShare ( ) . toByteArray ( ) ; byte [ ] primeData = share . getPrime ( ) . toByteArray ( ) ; byte n = new Integer ( share . getN ( ) ) . byteValue ( ) ; int len = 9 + SIGNATURE . length + shareData . length + primeData . length ; ByteBuffer bb = ByteBuffer . allocate ( len ) ; bb . put ( SIGNATURE ) ; bb . put ( n ) ; bb . putInt ( shareData . length ) ; bb . put ( shareData ) ; bb . putInt ( primeData . length ) ; bb . put ( primeData ) ; assert bb . position ( ) == bb . capacity ( ) ; assert bb . hasArray ( ) ; return bb . array ( ) ;
|
public class MercatorProjection { /** * Converts a pixel X coordinate at a certain scale to a longitude coordinate .
* @ param pixelX the pixel X coordinate that should be converted .
* @ param scaleFactor the scale factor at which the coordinate should be converted .
* @ return the longitude value of the pixel X coordinate .
* @ throws IllegalArgumentException if the given pixelX coordinate is invalid . */
public static double pixelXToLongitudeWithScaleFactor ( double pixelX , double scaleFactor , int tileSize ) { } }
|
long mapSize = getMapSizeWithScaleFactor ( scaleFactor , tileSize ) ; if ( pixelX < 0 || pixelX > mapSize ) { throw new IllegalArgumentException ( "invalid pixelX coordinate at scale " + scaleFactor + ": " + pixelX ) ; } return 360 * ( ( pixelX / mapSize ) - 0.5 ) ;
|
public class NativePlatform { /** * Called once during JavaFX shutdown to release platform resources . */
void shutdown ( ) { } }
|
runnableProcessor . shutdown ( ) ; if ( cursor != null ) { cursor . shutdown ( ) ; } if ( screen != null ) { screen . shutdown ( ) ; }
|
public class LoginHandler { /** * The instance method checks if for the given user the password is
* correct . The test itself is done with the JAAS module from Java . < br / > If
* a person is found and successfully logged in , the last login information
* from the person is updated to current time stamp .
* @ param _ name name of the person name to check
* @ param _ passwd password of the person to check
* @ return found person
* @ see # getPerson ( LoginContext )
* @ see # createPerson ( LoginContext )
* @ see # updatePerson ( LoginContext , Person )
* @ see # updateRoles ( LoginContext , Person )
* @ see # updateGroups ( LoginContext , Person ) */
public Person checkLogin ( final String _name , final String _passwd ) { } }
|
Person person = null ; try { final LoginCallbackHandler callback = new LoginCallbackHandler ( ActionCallback . Mode . LOGIN , _name , _passwd ) ; final LoginContext login = new LoginContext ( getApplicationName ( ) , callback ) ; login . login ( ) ; person = getPerson ( login ) ; if ( person == null ) { person = createPerson ( login ) ; } if ( person != null ) { updatePerson ( login , person ) ; person . cleanUp ( ) ; updateRoles ( login , person ) ; updateGroups ( login , person ) ; updateCompanies ( login , person ) ; person . updateLastLogin ( ) ; } } catch ( final EFapsException e ) { LoginHandler . LOG . error ( "login failed for '" + _name + "'" , e ) ; } catch ( final LoginException e ) { LoginHandler . LOG . error ( "login failed for '" + _name + "'" , e ) ; } return person ;
|
public class InsertAction { /** * XMLFilter methods */
@ Override public void startPrefixMapping ( String prefix , String uri ) throws SAXException { } }
|
if ( elemLevel != 0 ) { getContentHandler ( ) . startPrefixMapping ( prefix , uri ) ; }
|
public class NeuralNetworkParser { /** * 从txt加载
* @ param path
* @ return */
public boolean loadTxt ( String path ) { } }
|
IOUtil . LineIterator lineIterator = new IOUtil . LineIterator ( path ) ; model_header = lineIterator . next ( ) ; if ( model_header == null ) return false ; root = lineIterator . next ( ) ; use_distance = "1" . equals ( lineIterator . next ( ) ) ; use_valency = "1" . equals ( lineIterator . next ( ) ) ; use_cluster = "1" . equals ( lineIterator . next ( ) ) ; W1 = read_matrix ( lineIterator ) ; W2 = read_matrix ( lineIterator ) ; E = read_matrix ( lineIterator ) ; b1 = read_vector ( lineIterator ) ; saved = read_matrix ( lineIterator ) ; forms_alphabet = read_alphabet ( lineIterator ) ; postags_alphabet = read_alphabet ( lineIterator ) ; deprels_alphabet = read_alphabet ( lineIterator ) ; precomputation_id_encoder = read_map ( lineIterator ) ; if ( use_cluster ) { cluster4_types_alphabet = read_alphabet ( lineIterator ) ; cluster6_types_alphabet = read_alphabet ( lineIterator ) ; cluster_types_alphabet = read_alphabet ( lineIterator ) ; form_to_cluster4 = read_map ( lineIterator ) ; form_to_cluster6 = read_map ( lineIterator ) ; form_to_cluster = read_map ( lineIterator ) ; } assert ! lineIterator . hasNext ( ) : "文件有残留,可能是读取逻辑不对" ; classifier = new NeuralNetworkClassifier ( W1 , W2 , E , b1 , saved , precomputation_id_encoder ) ; classifier . canonical ( ) ; return true ;
|
public class Converter { /** * Todo : change this so the Cmd class being used in the conversion
* can itself have " editor " methods - - static methods like the ones below
* The ' public static Foo create ( String ) ' method would take precedence over
* all other " editor " logic . */
public static Object convert ( final Object value , Class < ? > targetType , final String name ) { } }
|
if ( value == null ) { if ( targetType . equals ( Boolean . TYPE ) ) { return false ; } return value ; } final Class < ? extends Object > actualType = value . getClass ( ) ; if ( targetType . isPrimitive ( ) ) { targetType = PrimitiveTypes . valueOf ( targetType . toString ( ) . toUpperCase ( ) ) . getWraper ( ) ; } if ( targetType . isAssignableFrom ( actualType ) ) { return value ; } if ( Number . class . isAssignableFrom ( actualType ) && Number . class . isAssignableFrom ( targetType ) ) { return value ; } if ( ! ( value instanceof String ) ) { final String message = String . format ( "Expected type '%s' for '%s'. Found '%s'" , targetType . getName ( ) , name , actualType . getName ( ) ) ; throw new IllegalArgumentException ( message ) ; } final String stringValue = ( String ) value ; if ( Enum . class . isAssignableFrom ( targetType ) ) { final Class < ? extends Enum > enumType = ( Class < ? extends Enum > ) targetType ; try { return Enum . valueOf ( enumType , stringValue ) ; } catch ( final IllegalArgumentException e ) { try { return Enum . valueOf ( enumType , stringValue . toUpperCase ( ) ) ; } catch ( final IllegalArgumentException e1 ) { return Enum . valueOf ( enumType , stringValue . toLowerCase ( ) ) ; } } } try { // Force static initializers to run
Class . forName ( targetType . getName ( ) , true , targetType . getClassLoader ( ) ) ; } catch ( final ClassNotFoundException e ) { e . printStackTrace ( ) ; } final PropertyEditor editor = Editors . get ( targetType ) ; if ( editor == null ) { final Object result = create ( targetType , stringValue ) ; if ( result != null ) { return result ; } } if ( editor == null ) { final String message = String . format ( "Cannot convert to '%s' for '%s'. No PropertyEditor" , targetType . getName ( ) , name ) ; throw new IllegalArgumentException ( message ) ; } editor . setAsText ( stringValue ) ; return editor . getValue ( ) ;
|
public class AbstractWComponent { /** * { @ inheritDoc }
* @ deprecated Use { @ link WTemplate } instead */
@ Deprecated @ Override public void setTag ( final String tag ) { } }
|
ComponentModel model = getOrCreateComponentModel ( ) ; model . setTag ( tag ) ;
|
public class AmazonEC2Client { /** * Describes one or more versions of a specified launch template . You can describe all versions , individual
* versions , or a range of versions .
* @ param describeLaunchTemplateVersionsRequest
* @ return Result of the DescribeLaunchTemplateVersions operation returned by the service .
* @ sample AmazonEC2 . DescribeLaunchTemplateVersions
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / ec2-2016-11-15 / DescribeLaunchTemplateVersions "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public DescribeLaunchTemplateVersionsResult describeLaunchTemplateVersions ( DescribeLaunchTemplateVersionsRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeDescribeLaunchTemplateVersions ( request ) ;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.