signature
stringlengths 43
39.1k
| implementation
stringlengths 0
450k
|
|---|---|
public class ProtobufIOUtil { /** * Parses the { @ code messages } ( delimited ) from the { @ link InputStream }
* using the given { @ code schema } .
* @ return the list containing the messages . */
public static Vector parseListFrom ( InputStream in , Schema schema ) throws IOException { } }
|
final Vector list = new Vector ( ) ; byte [ ] buf = null ; int biggestLen = 0 ; LimitedInputStream lin = null ; for ( int size = in . read ( ) ; size != - 1 ; size = in . read ( ) ) { final Object message = schema . newMessage ( ) ; list . addElement ( message ) ; final int len = size < 0x80 ? size : CodedInput . readRawVarint32 ( in , size ) ; if ( len != 0 ) { // not an empty message
if ( len > CodedInput . DEFAULT_BUFFER_SIZE ) { // message too big
if ( lin == null ) lin = new LimitedInputStream ( in ) ; final CodedInput input = new CodedInput ( lin . limit ( len ) , false ) ; schema . mergeFrom ( input , message ) ; input . checkLastTagWas ( 0 ) ; continue ; } if ( biggestLen < len ) { // cannot reuse buffer , allocate a bigger buffer
// discard the last one for gc
buf = new byte [ len ] ; biggestLen = len ; } IOUtil . fillBufferFrom ( in , buf , 0 , len ) ; final ByteArrayInput input = new ByteArrayInput ( buf , 0 , len , false ) ; try { schema . mergeFrom ( input , message ) ; } catch ( ArrayIndexOutOfBoundsException e ) { throw ProtobufException . truncatedMessage ( e ) ; } input . checkLastTagWas ( 0 ) ; } } return list ;
|
public class Types { /** * Returns type information for Java arrays of primitive type ( such as < code > byte [ ] < / code > ) . The array
* must not be null .
* @ param elementType element type of the array ( e . g . Types . BOOLEAN , Types . INT , Types . DOUBLE ) */
public static TypeInformation < ? > PRIMITIVE_ARRAY ( TypeInformation < ? > elementType ) { } }
|
if ( elementType == BOOLEAN ) { return PrimitiveArrayTypeInfo . BOOLEAN_PRIMITIVE_ARRAY_TYPE_INFO ; } else if ( elementType == BYTE ) { return PrimitiveArrayTypeInfo . BYTE_PRIMITIVE_ARRAY_TYPE_INFO ; } else if ( elementType == SHORT ) { return PrimitiveArrayTypeInfo . SHORT_PRIMITIVE_ARRAY_TYPE_INFO ; } else if ( elementType == INT ) { return PrimitiveArrayTypeInfo . INT_PRIMITIVE_ARRAY_TYPE_INFO ; } else if ( elementType == LONG ) { return PrimitiveArrayTypeInfo . LONG_PRIMITIVE_ARRAY_TYPE_INFO ; } else if ( elementType == FLOAT ) { return PrimitiveArrayTypeInfo . FLOAT_PRIMITIVE_ARRAY_TYPE_INFO ; } else if ( elementType == DOUBLE ) { return PrimitiveArrayTypeInfo . DOUBLE_PRIMITIVE_ARRAY_TYPE_INFO ; } else if ( elementType == CHAR ) { return PrimitiveArrayTypeInfo . CHAR_PRIMITIVE_ARRAY_TYPE_INFO ; } throw new IllegalArgumentException ( "Invalid element type for a primitive array." ) ;
|
public class QueryCompileErrorLocationMarshaller { /** * Marshall the given parameter object . */
public void marshall ( QueryCompileErrorLocation queryCompileErrorLocation , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( queryCompileErrorLocation == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( queryCompileErrorLocation . getStartCharOffset ( ) , STARTCHAROFFSET_BINDING ) ; protocolMarshaller . marshall ( queryCompileErrorLocation . getEndCharOffset ( ) , ENDCHAROFFSET_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class PropertyValuesHolder { /** * Internal function ( called from ObjectAnimator ) to set up the setter and getter
* prior to running the animation . If the setter has not been manually set for this
* object , it will be derived automatically given the property name , target object , and
* types of values supplied . If no getter has been set , it will be supplied iff any of the
* supplied values was null . If there is a null value , then the getter ( supplied or derived )
* will be called to set those null values to the current value of the property
* on the target object .
* @ param target The object on which the setter ( and possibly getter ) exist . */
void setupSetterAndGetter ( Object target ) { } }
|
if ( mProperty != null ) { // check to make sure that mProperty is on the class of target
try { Object testValue = mProperty . get ( target ) ; for ( Keyframe kf : mKeyframeSet . mKeyframes ) { if ( ! kf . hasValue ( ) ) { kf . setValue ( mProperty . get ( target ) ) ; } } return ; } catch ( ClassCastException e ) { Log . e ( "PropertyValuesHolder" , "No such property (" + mProperty . getName ( ) + ") on target object " + target + ". Trying reflection instead" ) ; mProperty = null ; } } Class targetClass = target . getClass ( ) ; if ( mSetter == null ) { setupSetter ( targetClass ) ; } for ( Keyframe kf : mKeyframeSet . mKeyframes ) { if ( ! kf . hasValue ( ) ) { if ( mGetter == null ) { setupGetter ( targetClass ) ; } try { kf . setValue ( mGetter . invoke ( target ) ) ; } catch ( InvocationTargetException e ) { Log . e ( "PropertyValuesHolder" , e . toString ( ) ) ; } catch ( IllegalAccessException e ) { Log . e ( "PropertyValuesHolder" , e . toString ( ) ) ; } } }
|
public class ColorPository { /** * Adds a fully configured color class record to the pository . This is only called by the XML
* parsing code , so pay it no mind . */
public void addClass ( ClassRecord record ) { } }
|
// validate the class id
if ( record . classId > 255 ) { log . warning ( "Refusing to add class; classId > 255 " + record + "." ) ; } else { _classes . put ( record . classId , record ) ; }
|
public class CommerceOrderUtil { /** * Returns the commerce order where uuid = & # 63 ; and groupId = & # 63 ; or throws a { @ link NoSuchOrderException } if it could not be found .
* @ param uuid the uuid
* @ param groupId the group ID
* @ return the matching commerce order
* @ throws NoSuchOrderException if a matching commerce order could not be found */
public static CommerceOrder findByUUID_G ( String uuid , long groupId ) throws com . liferay . commerce . exception . NoSuchOrderException { } }
|
return getPersistence ( ) . findByUUID_G ( uuid , groupId ) ;
|
public class ThemeUtil { /** * Obtains the float value , which corresponds to a specific resource id , from a context ' s
* theme .
* @ param context
* The context , which should be used , as an instance of the class { @ link Context } . The
* context may not be null
* @ param resourceId
* The resource id of the attribute , which should be obtained , as an { @ link Integer }
* value . The resource id must corresponds to a valid theme attribute
* @ param defaultValue
* The default value , which should be returned , if the given resource id is invalid , as
* a { @ link Float } value
* @ return The float value , which has been obtained , as a { @ link Float } value or 0 , if the given
* resource id is invalid */
public static float getFloat ( @ NonNull final Context context , @ AttrRes final int resourceId , final float defaultValue ) { } }
|
return getFloat ( context , - 1 , resourceId , defaultValue ) ;
|
public class Response { /** * 设定返回给客户端的Cookie < br >
* Path : " / " < br >
* No Domain
* @ param name cookie名
* @ param value cookie值
* @ param maxAgeInSeconds - 1 : 关闭浏览器清除Cookie . 0 : 立即清除Cookie . n > 0 : Cookie存在的秒数 . */
public final static void addCookie ( String name , String value , int maxAgeInSeconds ) { } }
|
addCookie ( name , value , maxAgeInSeconds , "/" , null ) ;
|
public class SelectStatement { /** * Get alias .
* @ param name name or alias
* @ return alias */
public Optional < String > getAlias ( final String name ) { } }
|
if ( containStar ) { return Optional . absent ( ) ; } String rawName = SQLUtil . getExactlyValue ( name ) ; for ( SelectItem each : items ) { if ( SQLUtil . getExactlyExpression ( rawName ) . equalsIgnoreCase ( SQLUtil . getExactlyExpression ( SQLUtil . getExactlyValue ( each . getExpression ( ) ) ) ) ) { return each . getAlias ( ) ; } if ( rawName . equalsIgnoreCase ( each . getAlias ( ) . orNull ( ) ) ) { return Optional . of ( rawName ) ; } } return Optional . absent ( ) ;
|
public class StitchingFromMotion2D { /** * Specifies size of stitch image and the location of the initial coordinate system .
* @ param widthStitch Width of the image being stitched into
* @ param heightStitch Height of the image being stitched into
* @ param worldToInit ( Option ) Used to change the location of the initial frame in stitched image .
* null means no transform . */
public void configure ( int widthStitch , int heightStitch , IT worldToInit ) { } }
|
this . worldToInit = ( IT ) worldToCurr . createInstance ( ) ; if ( worldToInit != null ) this . worldToInit . set ( worldToInit ) ; this . widthStitch = widthStitch ; this . heightStitch = heightStitch ;
|
public class Sendinblue { /** * Delete your campaigns .
* @ param { Object } data contains json objects as a key value pair from HashMap .
* @ options data { Integer } id : Id of campaign to be deleted [ Mandatory ] */
public String delete_campaign ( Map < String , Object > data ) { } }
|
String id = data . get ( "id" ) . toString ( ) ; return delete ( "campaign/" + id , EMPTY_STRING ) ;
|
public class AbstractIncrementalDFADAGBuilder { /** * Returns ( and possibly creates ) the canonical state for the given signature .
* @ param sig
* the signature
* @ return the canonical state for the given signature */
protected State replaceOrRegister ( StateSignature sig ) { } }
|
State state = register . get ( sig ) ; if ( state != null ) { return state ; } state = new State ( sig ) ; register . put ( sig , state ) ; for ( int i = 0 ; i < sig . successors . array . length ; i ++ ) { State succ = sig . successors . array [ i ] ; if ( succ != null ) { succ . increaseIncoming ( ) ; } } return state ;
|
public class DefaultNamingStrategy { public static String underscoreSeparated ( String camelCaseName ) { } }
|
return StringUtils . lowerCase ( Arrays . stream ( StringUtils . split ( camelCaseName , SubFacet . SEPARATOR ) ) . flatMap ( component -> Arrays . stream ( StringUtils . splitByCharacterTypeCamelCase ( component ) ) ) . collect ( Collectors . joining ( "_" ) ) ) ;
|
public class AbstractExcelWriter { /** * 创建一个自定义颜色 , 仅适用于XLSX类型Excel文件 。
* 你可以使用 { @ link XSSFCellStyle # setFillForegroundColor ( XSSFColor ) }
* 来使用自定义颜色
* @ param r red
* @ param g green
* @ param b blue
* @ return 一个新的自定义颜色
* @ throws WriteExcelException 异常
* @ see # createXLSXCellStyle ( )
* @ see # createXLSXColor ( int , int , int , int )
* @ see # getXLSPalette ( ) */
public XSSFColor createXLSXColor ( int r , int g , int b ) throws WriteExcelException { } }
|
return this . createXLSXColor ( r , g , b , 255 ) ;
|
public class SecurityPolicyClient { /** * Deletes a rule at the specified priority .
* < p > Sample code :
* < pre > < code >
* try ( SecurityPolicyClient securityPolicyClient = SecurityPolicyClient . create ( ) ) {
* Integer priority = 0;
* ProjectGlobalSecurityPolicyName securityPolicy = ProjectGlobalSecurityPolicyName . of ( " [ PROJECT ] " , " [ SECURITY _ POLICY ] " ) ;
* Operation response = securityPolicyClient . removeRuleSecurityPolicy ( priority , securityPolicy . toString ( ) ) ;
* < / code > < / pre >
* @ param priority The priority of the rule to remove from the security policy .
* @ param securityPolicy Name of the security policy to update .
* @ throws com . google . api . gax . rpc . ApiException if the remote call fails */
@ BetaApi public final Operation removeRuleSecurityPolicy ( Integer priority , String securityPolicy ) { } }
|
RemoveRuleSecurityPolicyHttpRequest request = RemoveRuleSecurityPolicyHttpRequest . newBuilder ( ) . setPriority ( priority ) . setSecurityPolicy ( securityPolicy ) . build ( ) ; return removeRuleSecurityPolicy ( request ) ;
|
public class MappingIDTreeModelFilter { /** * A helper method to check a match */
public static boolean match ( String keyword , String mappingId ) { } }
|
if ( mappingId . indexOf ( keyword ) != - 1 ) { // match found !
return true ; } return false ;
|
public class WebSiteManagementClientImpl { /** * Gets the source controls available for Azure websites .
* Gets the source controls available for Azure websites .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < List < SourceControlInner > > listSourceControlsAsync ( final ListOperationCallback < SourceControlInner > serviceCallback ) { } }
|
return AzureServiceFuture . fromPageResponse ( listSourceControlsSinglePageAsync ( ) , new Func1 < String , Observable < ServiceResponse < Page < SourceControlInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < SourceControlInner > > > call ( String nextPageLink ) { return listSourceControlsNextSinglePageAsync ( nextPageLink ) ; } } , serviceCallback ) ;
|
public class SecurityDomainJBossASClient { /** * send a : flush - cache operation to the passed security domain
* @ param domain simple name of the domain
* @ throws Exception any error */
public void flushSecurityDomainCache ( String domain ) throws Exception { } }
|
Address addr = Address . root ( ) . add ( SUBSYSTEM , SUBSYSTEM_SECURITY , SECURITY_DOMAIN , domain ) ; ModelNode request = createRequest ( "flush-cache" , addr ) ; ModelNode result = execute ( request ) ; if ( ! isSuccess ( result ) ) { log . warn ( "Flushing " + domain + " failed - principals may be longer cached than expected" ) ; }
|
public class RestHandlerExceptionResolverBuilder { /** * The default content type that will be used as a fallback when the requested content type is
* not supported . */
public RestHandlerExceptionResolverBuilder defaultContentType ( String mediaType ) { } }
|
defaultContentType ( hasText ( mediaType ) ? MediaType . parseMediaType ( mediaType ) : null ) ; return this ;
|
public class UnionNodeImpl { /** * Projects away variables only for child construction nodes */
private IQTree projectAwayUnnecessaryVariables ( IQTree child , IQProperties currentIQProperties ) { } }
|
if ( child . getRootNode ( ) instanceof ConstructionNode ) { ConstructionNode constructionNode = ( ConstructionNode ) child . getRootNode ( ) ; AscendingSubstitutionNormalization normalization = normalizeAscendingSubstitution ( constructionNode . getSubstitution ( ) , projectedVariables ) ; Optional < ConstructionNode > proposedConstructionNode = normalization . generateTopConstructionNode ( ) ; if ( proposedConstructionNode . filter ( c -> c . isSyntacticallyEquivalentTo ( constructionNode ) ) . isPresent ( ) ) return child ; IQTree grandChild = normalization . normalizeChild ( ( ( UnaryIQTree ) child ) . getChild ( ) ) ; return proposedConstructionNode . map ( c -> ( IQTree ) iqFactory . createUnaryIQTree ( c , grandChild , currentIQProperties . declareLifted ( ) ) ) . orElse ( grandChild ) ; } else return child ;
|
public class ASTHelpers { /** * Given a TreePath , finds the first enclosing node of the given type and returns the path from
* the enclosing node to the top - level { @ code CompilationUnitTree } . */
public static < T > TreePath findPathFromEnclosingNodeToTopLevel ( TreePath path , Class < T > klass ) { } }
|
if ( path != null ) { do { path = path . getParentPath ( ) ; } while ( path != null && ! ( klass . isInstance ( path . getLeaf ( ) ) ) ) ; } return path ;
|
public class SubscriptionService { /** * Temporary pauses a subscription . < br >
* < br >
* < strong > NOTE < / strong > < br >
* Pausing is permitted until one day ( 24 hours ) before the next charge date .
* @ param subscription
* the subscription
* @ return the updated subscription */
public Subscription pause ( Subscription subscription ) { } }
|
ParameterMap < String , String > params = new ParameterMap < String , String > ( ) ; params . add ( "pause" , String . valueOf ( true ) ) ; return RestfulUtils . update ( SubscriptionService . PATH , subscription , params , false , Subscription . class , super . httpClient ) ;
|
public class DefaultRewriteContentHandler { /** * URL - decode value if required .
* @ param value Probably encoded value .
* @ return Decoded value */
private String decodeIfEncoded ( String value ) { } }
|
if ( StringUtils . contains ( value , "%" ) ) { try { return URLDecoder . decode ( value , CharEncoding . UTF_8 ) ; } catch ( UnsupportedEncodingException ex ) { throw new RuntimeException ( ex ) ; } } return value ;
|
public class AnnotatedTypeBuilder { /** * Reads the annotations from an existing java type . If overwrite is true
* then existing annotations will be overwritten
* @ param type the type to read from
* @ param overwrite if true , the read annotation will replace any existing
* annotation */
public AnnotatedTypeBuilder < X > readFromType ( Class < X > type , boolean overwrite ) { } }
|
if ( type == null ) { throw log . parameterMustNotBeNull ( "type" ) ; } if ( javaClass == null || overwrite ) { this . javaClass = type ; } for ( Annotation annotation : type . getAnnotations ( ) ) { if ( overwrite || ! typeAnnotations . isAnnotationPresent ( annotation . annotationType ( ) ) ) { typeAnnotations . add ( annotation ) ; } } for ( Field field : Reflections . getAllDeclaredFields ( type ) ) { AnnotationBuilder annotationBuilder = fields . get ( field ) ; if ( annotationBuilder == null ) { annotationBuilder = new AnnotationBuilder ( ) ; fields . put ( field , annotationBuilder ) ; } field . setAccessible ( true ) ; for ( Annotation annotation : field . getAnnotations ( ) ) { if ( overwrite || ! annotationBuilder . isAnnotationPresent ( annotation . annotationType ( ) ) ) { annotationBuilder . add ( annotation ) ; } } } for ( Method method : Reflections . getAllDeclaredMethods ( type ) ) { AnnotationBuilder annotationBuilder = methods . get ( method ) ; if ( annotationBuilder == null ) { annotationBuilder = new AnnotationBuilder ( ) ; methods . put ( method , annotationBuilder ) ; } method . setAccessible ( true ) ; for ( Annotation annotation : method . getAnnotations ( ) ) { if ( overwrite || ! annotationBuilder . isAnnotationPresent ( annotation . annotationType ( ) ) ) { annotationBuilder . add ( annotation ) ; } } Map < Integer , AnnotationBuilder > parameters = methodParameters . get ( method ) ; if ( parameters == null ) { parameters = new HashMap < Integer , AnnotationBuilder > ( ) ; methodParameters . put ( method , parameters ) ; } for ( int i = 0 ; i < method . getParameterTypes ( ) . length ; ++ i ) { AnnotationBuilder parameterAnnotationBuilder = parameters . get ( i ) ; if ( parameterAnnotationBuilder == null ) { parameterAnnotationBuilder = new AnnotationBuilder ( ) ; parameters . put ( i , parameterAnnotationBuilder ) ; } for ( Annotation annotation : method . getParameterAnnotations ( ) [ i ] ) { if ( overwrite || ! parameterAnnotationBuilder . isAnnotationPresent ( annotation . annotationType ( ) ) ) { parameterAnnotationBuilder . add ( annotation ) ; } } } } for ( Constructor < ? > constructor : type . getDeclaredConstructors ( ) ) { AnnotationBuilder annotationBuilder = constructors . get ( constructor ) ; if ( annotationBuilder == null ) { annotationBuilder = new AnnotationBuilder ( ) ; constructors . put ( constructor , annotationBuilder ) ; } constructor . setAccessible ( true ) ; for ( Annotation annotation : constructor . getAnnotations ( ) ) { if ( overwrite || ! annotationBuilder . isAnnotationPresent ( annotation . annotationType ( ) ) ) { annotationBuilder . add ( annotation ) ; } } Map < Integer , AnnotationBuilder > mparams = constructorParameters . get ( constructor ) ; if ( mparams == null ) { mparams = new HashMap < Integer , AnnotationBuilder > ( ) ; constructorParameters . put ( constructor , mparams ) ; } for ( int i = 0 ; i < constructor . getParameterTypes ( ) . length ; ++ i ) { AnnotationBuilder parameterAnnotationBuilder = mparams . get ( i ) ; if ( parameterAnnotationBuilder == null ) { parameterAnnotationBuilder = new AnnotationBuilder ( ) ; mparams . put ( i , parameterAnnotationBuilder ) ; } for ( Annotation annotation : constructor . getParameterAnnotations ( ) [ i ] ) { if ( overwrite || ! parameterAnnotationBuilder . isAnnotationPresent ( annotation . annotationType ( ) ) ) { annotationBuilder . add ( annotation ) ; } } } } return this ;
|
public class CodedOutputStream { /** * Write part of a byte string . */
public void writeRawBytes ( final ByteString value , int offset , int length ) throws IOException { } }
|
if ( limit - position >= length ) { // We have room in the current buffer .
value . copyTo ( buffer , offset , position , length ) ; position += length ; } else { // Write extends past current buffer . Fill the rest of this buffer and
// flush .
final int bytesWritten = limit - position ; value . copyTo ( buffer , offset , position , bytesWritten ) ; offset += bytesWritten ; length -= bytesWritten ; position = limit ; refreshBuffer ( ) ; // Now deal with the rest .
// Since we have an output stream , this is our buffer
// and buffer offset = = 0
if ( length <= limit ) { // Fits in new buffer .
value . copyTo ( buffer , offset , 0 , length ) ; position = length ; } else { // Write is very big , but we can ' t do it all at once without allocating
// an a copy of the byte array since ByteString does not give us access
// to the underlying bytes . Use the InputStream interface on the
// ByteString and our buffer to copy between the two .
InputStream inputStreamFrom = value . newInput ( ) ; if ( offset != inputStreamFrom . skip ( offset ) ) { throw new IllegalStateException ( "Skip failed? Should never happen." ) ; } // Use the buffer as the temporary buffer to avoid allocating memory .
while ( length > 0 ) { int bytesToRead = Math . min ( length , limit ) ; int bytesRead = inputStreamFrom . read ( buffer , 0 , bytesToRead ) ; if ( bytesRead != bytesToRead ) { throw new IllegalStateException ( "Read failed? Should never happen" ) ; } output . write ( buffer , 0 , bytesRead ) ; length -= bytesRead ; } } }
|
public class TransformProcess { /** * Infer the categories for the given record reader for
* a particular set of columns ( this is more efficient than
* { @ link # inferCategories ( RecordReader , int ) }
* if you have more than one column you plan on inferring categories for )
* Note that each " column index " is a column in the context of :
* List < Writable > record = . . . ;
* record . get ( columnIndex ) ;
* Note that anything passed in as a column will be automatically converted to a
* string for categorical purposes . Results may vary depending on what ' s passed in .
* The * expected * input is strings or numbers ( which have sensible toString ( ) representations )
* Note that the returned categories will be sorted alphabetically , for each column
* @ param recordReader the record reader to scan
* @ param columnIndices the column indices the get
* @ return the inferred categories */
public static Map < Integer , List < String > > inferCategories ( RecordReader recordReader , int [ ] columnIndices ) { } }
|
if ( columnIndices == null || columnIndices . length < 1 ) { return Collections . emptyMap ( ) ; } Map < Integer , List < String > > categoryMap = new HashMap < > ( ) ; Map < Integer , Set < String > > categories = new HashMap < > ( ) ; for ( int i = 0 ; i < columnIndices . length ; i ++ ) { categoryMap . put ( columnIndices [ i ] , new ArrayList < String > ( ) ) ; categories . put ( columnIndices [ i ] , new HashSet < String > ( ) ) ; } while ( recordReader . hasNext ( ) ) { List < Writable > next = recordReader . next ( ) ; for ( int i = 0 ; i < columnIndices . length ; i ++ ) { if ( columnIndices [ i ] >= next . size ( ) ) { log . warn ( "Filtering out example: Invalid length of columns" ) ; continue ; } categories . get ( columnIndices [ i ] ) . add ( next . get ( columnIndices [ i ] ) . toString ( ) ) ; } } for ( int i = 0 ; i < columnIndices . length ; i ++ ) { categoryMap . get ( columnIndices [ i ] ) . addAll ( categories . get ( columnIndices [ i ] ) ) ; // Sort categories alphabetically - HashSet and RecordReader orders are not deterministic in general
Collections . sort ( categoryMap . get ( columnIndices [ i ] ) ) ; } return categoryMap ;
|
public class StaticCATXATransaction { /** * Calls commit ( ) on the SIXAResource .
* Fields :
* BIT16 XAResourceId
* The XID Structure
* BYTE OnePhase ( 0x00 = false , 0x01 = true )
* @ param request
* @ param conversation
* @ param requestNumber
* @ param allocatedFromBufferPool
* @ param partOfExchange */
public static void rcvXACommit ( CommsByteBuffer request , Conversation conversation , int requestNumber , boolean allocatedFromBufferPool , boolean partOfExchange ) { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "rcvXACommit" , new Object [ ] { request , conversation , "" + requestNumber , "" + allocatedFromBufferPool , "" + partOfExchange } ) ; ConversationState convState = ( ConversationState ) conversation . getAttachment ( ) ; ServerLinkLevelState linkState = ( ServerLinkLevelState ) conversation . getLinkLevelAttachment ( ) ; boolean onePhase = false ; final boolean optimizedTx = CommsUtils . requiresOptimizedTransaction ( conversation ) ; try { int clientTransactionId = request . getInt ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "XAResource Object ID" , clientTransactionId ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Getting Xid" ) ; XidProxy xid = ( XidProxy ) request . getXid ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Completed:" , xid ) ; byte onePhaseByte = request . get ( ) ; if ( onePhaseByte == 1 ) onePhase = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "One phase:" , onePhase ) ; boolean endRequired = false ; int endFlags = 0 ; if ( optimizedTx ) { endRequired = request . get ( ) == 0x01 ; endFlags = request . getInt ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "End Required:" , "" + endRequired ) ; SibTr . debug ( tc , "End Flags:" , "" + endFlags ) ; } } boolean requiresMSResource = false ; if ( conversation . getHandshakeProperties ( ) . getFapLevel ( ) >= JFapChannelConstants . FAP_VERSION_5 ) { requiresMSResource = request . get ( ) == 0x01 ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Requires MS Resource:" , "" + requiresMSResource ) ; } // Get the transaction out of the table
IdToTransactionTable transactionTable = linkState . getTransactionTable ( ) ; if ( endRequired ) transactionTable . endOptimizedGlobalTransactionBranch ( clientTransactionId , endFlags ) ; SITransaction tran = null ; // As commits ( for the same XAResource ) can be scheduled concurrently by the receive listener
// dispatcher - perform all updates to the IdToTransaction table inside a synchronized block .
boolean isInvalidTransaction = false ; boolean isUnitOfWorkInError = false ; Throwable rollbackException = null ; synchronized ( transactionTable ) { tran = transactionTable . getResourceForGlobalTransactionBranch ( clientTransactionId , xid ) ; if ( tran != null ) { isInvalidTransaction = tran == IdToTransactionTable . INVALID_TRANSACTION ; if ( ! isInvalidTransaction ) { isUnitOfWorkInError = transactionTable . isGlobalTransactionBranchRollbackOnly ( clientTransactionId , xid ) ; } if ( isInvalidTransaction || isUnitOfWorkInError ) { rollbackException = transactionTable . getExceptionForRollbackOnlyGlobalTransactionBranch ( clientTransactionId , xid ) ; } // Leave the invalid transaction in the table . The only way to remove it is to
// roll it back .
if ( ! isInvalidTransaction ) { transactionTable . removeGlobalTransactionBranch ( clientTransactionId , xid ) ; } } } SIXAResource xaResource = getResourceFromTran ( tran , convState , requiresMSResource ) ; // If the UOW was never created ( because we were running with the
// optimization that gets an XAResource and enlists it as part of the
// first piece of transacted work and this failed ) then throw
// an exception notifying the caller that the UOW has been rolled back .
if ( isInvalidTransaction ) { String errorMsg = nls . getFormattedMessage ( "TRANSACTION_MARKED_AS_ERROR_SICO2029" , new Object [ ] { rollbackException } , null ) ; XAException xa = new XAException ( errorMsg ) ; xa . initCause ( rollbackException ) ; xa . errorCode = XAException . XA_RBOTHER ; throw xa ; } if ( isUnitOfWorkInError ) { // PK59276 Rollback the transaction , as after we throw a XA _ RB * error the
// transaction manager will not call us with xa _ rollback .
xaResource . rollback ( xid ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "The transaction was marked as error due to" , rollbackException ) ; // And respond with an error
XAException xa = new XAException ( nls . getFormattedMessage ( "TRANSACTION_MARKED_AS_ERROR_SICO2029" , new Object [ ] { rollbackException } , null ) ) ; xa . initCause ( rollbackException ) ; xa . errorCode = XAException . XA_RBOTHER ; throw xa ; } // Now call the method on the XA resource
xaResource . commit ( xid , onePhase ) ; try { conversation . send ( poolManager . allocate ( ) , JFapChannelConstants . SEG_XACOMMIT_R , requestNumber , JFapChannelConstants . PRIORITY_MEDIUM , true , ThrottlingPolicy . BLOCK_THREAD , null ) ; } catch ( SIException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".rcvXACommit" , CommsConstants . STATICCATXATRANSACTION_XACOMMIT_01 ) ; SibTr . error ( tc , "COMMUNICATION_ERROR_SICO2027" , e ) ; } } catch ( XAException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".rcvXACommit" , CommsConstants . STATICCATXATRANSACTION_XACOMMIT_02 ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "XAException - RC: " + e . errorCode , e ) ; StaticCATHelper . sendExceptionToClient ( e , CommsConstants . STATICCATXATRANSACTION_XACOMMIT_02 , // d186970
conversation , requestNumber ) ; } request . release ( allocatedFromBufferPool ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "rcvXACommit" ) ;
|
public class Document { /** * Purges this document from the database ;
* this is more than deletion , it forgets entirely about it .
* The purge will NOT be replicated to other databases .
* @ throws CouchbaseLiteException */
@ InterfaceAudience . Public public void purge ( ) throws CouchbaseLiteException { } }
|
Map < String , List < String > > docsToRevs = new HashMap < String , List < String > > ( ) ; List < String > revs = new ArrayList < String > ( ) ; revs . add ( "*" ) ; docsToRevs . put ( documentId , revs ) ; database . purgeRevisions ( docsToRevs ) ; database . removeDocumentFromCache ( this ) ;
|
public class HexEncoder { /** * Encodes a single octet into two nibbles .
* @ param input the input byte array
* @ param inoff the offset in the input array
* @ param output the array to which each encoded nibbles are written .
* @ param outoff the offset in the output array . */
public static void encodeSingle ( final byte [ ] input , final int inoff , final byte [ ] output , final int outoff ) { } }
|
if ( input == null ) { throw new NullPointerException ( "input" ) ; } if ( inoff < 0 ) { throw new IllegalArgumentException ( "inoff(" + inoff + ") < 0" ) ; } if ( inoff >= input . length ) { throw new IllegalArgumentException ( "inoff(" + inoff + ") >= input.length(" + input . length + ")" ) ; } encodeSingle ( input [ inoff ] , output , outoff ) ;
|
public class StreamScanner { /** * Note : this is the base implementation used for implementing
* < code > ValidationContext < / code > */
@ Override public void reportValidationProblem ( XMLValidationProblem prob ) throws XMLStreamException { } }
|
// ! ! ! TBI : Fail - fast vs . deferred modes ?
/* For now let ' s implement basic functionality : warnings get
* reported via XMLReporter , errors and fatal errors result in
* immediate exceptions . */
/* 27 - May - 2008 , TSa : [ WSTX - 153 ] Above is incorrect : as per Stax
* javadocs for XMLReporter , both warnings and non - fatal errors
* ( which includes all validation errors ) should be reported via
* XMLReporter interface , and only fatals should cause an
* immediate stream exception ( by - passing reporter ) */
if ( prob . getSeverity ( ) > XMLValidationProblem . SEVERITY_ERROR ) { throw WstxValidationException . create ( prob ) ; } XMLReporter rep = mConfig . getXMLReporter ( ) ; if ( rep != null ) { _reportProblem ( rep , prob ) ; } else { /* If no reporter , regular non - fatal errors are to be reported
* as exceptions as well , for backwards compatibility */
if ( prob . getSeverity ( ) >= XMLValidationProblem . SEVERITY_ERROR ) { throw WstxValidationException . create ( prob ) ; } }
|
public class DescribeScheduledInstancesRequest { /** * The Scheduled Instance IDs .
* @ param scheduledInstanceIds
* The Scheduled Instance IDs . */
public void setScheduledInstanceIds ( java . util . Collection < String > scheduledInstanceIds ) { } }
|
if ( scheduledInstanceIds == null ) { this . scheduledInstanceIds = null ; return ; } this . scheduledInstanceIds = new com . amazonaws . internal . SdkInternalList < String > ( scheduledInstanceIds ) ;
|
public class AWSCodeCommitClient { /** * Deletes a repository . If a specified repository was already deleted , a null repository ID will be returned .
* < important >
* Deleting a repository also deletes all associated objects and metadata . After a repository is deleted , all future
* push calls to the deleted repository will fail .
* < / important >
* @ param deleteRepositoryRequest
* Represents the input of a delete repository operation .
* @ return Result of the DeleteRepository operation returned by the service .
* @ throws RepositoryNameRequiredException
* A repository name is required but was not specified .
* @ throws InvalidRepositoryNameException
* At least one specified repository name is not valid . < / p > < note >
* This exception only occurs when a specified repository name is not valid . Other exceptions occur when a
* required repository parameter is missing , or when a specified repository does not exist .
* @ throws EncryptionIntegrityChecksFailedException
* An encryption integrity check failed .
* @ throws EncryptionKeyAccessDeniedException
* An encryption key could not be accessed .
* @ throws EncryptionKeyDisabledException
* The encryption key is disabled .
* @ throws EncryptionKeyNotFoundException
* No encryption key was found .
* @ throws EncryptionKeyUnavailableException
* The encryption key is not available .
* @ sample AWSCodeCommit . DeleteRepository
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / codecommit - 2015-04-13 / DeleteRepository " target = " _ top " > AWS
* API Documentation < / a > */
@ Override public DeleteRepositoryResult deleteRepository ( DeleteRepositoryRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeDeleteRepository ( request ) ;
|
public class AccessPathNullnessPropagation { /** * If node represents a local , field access , or method call we can track , set it to be non - null in
* the updates */
private void setNonnullIfAnalyzeable ( Updates updates , Node node ) { } }
|
AccessPath ap = AccessPath . getAccessPathForNodeWithMapGet ( node , types ) ; if ( ap != null ) { updates . set ( ap , NONNULL ) ; }
|
public class UsageRecordReader { /** * Make the request to the Twilio API to perform the read .
* @ param client TwilioRestClient with which to make the request
* @ return UsageRecord ResourceSet */
@ Override public ResourceSet < UsageRecord > read ( final TwilioRestClient client ) { } }
|
return new ResourceSet < > ( this , client , firstPage ( client ) ) ;
|
public class NamespaceNotifierClient { /** * Called by the ConnectionManager when the connection state changed .
* The connection lock is hold when calling this method , so no
* other methods from the ConnectionManager should be called here .
* @ param newState the new state
* @ return when the new state is DISCONNECTED _ HIDDEN or DISCONNECTED _ VISIBLE ,
* then the return value is ignored . If the new state is CONNECTED ,
* then the return value shows if the NamespaceNotifierClient accepts
* or not the new server . If it isn ' t accepted , the ConnectionManager
* will try connecting to another server . */
boolean connectionStateChanged ( int newState ) { } }
|
switch ( newState ) { case ConnectionManager . CONNECTED : LOG . info ( listeningPort + ": Switched to CONNECTED state." ) ; // Try to resubscribe all the watched events
try { return resubscribe ( ) ; } catch ( Exception e ) { LOG . error ( listeningPort + ": Resubscribing failed" , e ) ; return false ; } case ConnectionManager . DISCONNECTED_VISIBLE : LOG . info ( listeningPort + ": Switched to DISCONNECTED_VISIBLE state" ) ; for ( NamespaceEventKey eventKey : watchedEvents . keySet ( ) ) watchedEvents . put ( eventKey , - 1L ) ; watcher . connectionFailed ( ) ; break ; case ConnectionManager . DISCONNECTED_HIDDEN : LOG . info ( listeningPort + ": Switched to DISCONNECTED_HIDDEN state." ) ; } return true ;
|
public class ConstructorFromUnmarshaller { /** * / * @ Override */
public S unmarshal ( T object ) { } }
|
if ( object != null && ! targetClass . isAssignableFrom ( object . getClass ( ) ) ) { throw new IllegalArgumentException ( "Supplied object was not instance of target class" ) ; } try { return unmarshal . newInstance ( object ) ; } catch ( IllegalAccessException ex ) { throw new IllegalStateException ( "Constructor is not accessible" ) ; } catch ( InstantiationException ex ) { throw new IllegalStateException ( "Constructor is not valid" ) ; } catch ( InvocationTargetException ex ) { if ( ex . getCause ( ) instanceof RuntimeException ) { throw ( RuntimeException ) ex . getCause ( ) ; } throw new BindingException ( ex . getMessage ( ) , ex . getCause ( ) ) ; }
|
public class Image { /** * Draw this image as part of a collection of images
* @ param x The x location to draw the image at
* @ param y The y location to draw the image at
* @ param width The width to render the image at
* @ param height The height to render the image at */
public void drawEmbedded ( float x , float y , float width , float height ) { } }
|
init ( ) ; if ( corners == null ) { GL . glTexCoord2f ( textureOffsetX , textureOffsetY ) ; GL . glVertex3f ( x , y , 0 ) ; GL . glTexCoord2f ( textureOffsetX , textureOffsetY + textureHeight ) ; GL . glVertex3f ( x , y + height , 0 ) ; GL . glTexCoord2f ( textureOffsetX + textureWidth , textureOffsetY + textureHeight ) ; GL . glVertex3f ( x + width , y + height , 0 ) ; GL . glTexCoord2f ( textureOffsetX + textureWidth , textureOffsetY ) ; GL . glVertex3f ( x + width , y , 0 ) ; } else { corners [ TOP_LEFT ] . bind ( ) ; GL . glTexCoord2f ( textureOffsetX , textureOffsetY ) ; GL . glVertex3f ( x , y , 0 ) ; corners [ BOTTOM_LEFT ] . bind ( ) ; GL . glTexCoord2f ( textureOffsetX , textureOffsetY + textureHeight ) ; GL . glVertex3f ( x , y + height , 0 ) ; corners [ BOTTOM_RIGHT ] . bind ( ) ; GL . glTexCoord2f ( textureOffsetX + textureWidth , textureOffsetY + textureHeight ) ; GL . glVertex3f ( x + width , y + height , 0 ) ; corners [ TOP_RIGHT ] . bind ( ) ; GL . glTexCoord2f ( textureOffsetX + textureWidth , textureOffsetY ) ; GL . glVertex3f ( x + width , y , 0 ) ; }
|
public class TypedInstanceToGraphMapper { /** * * * * * * PRIMITIVES * * * * * */
private void mapPrimitiveOrEnumToVertex ( ITypedInstance typedInstance , AtlasVertex instanceVertex , AttributeInfo attributeInfo ) throws AtlasException { } }
|
Object attrValue = typedInstance . get ( attributeInfo . name ) ; final String vertexPropertyName = GraphHelper . getQualifiedFieldName ( typedInstance , attributeInfo ) ; Object propertyValue = null ; if ( attrValue == null ) { propertyValue = null ; } else if ( attributeInfo . dataType ( ) == DataTypes . STRING_TYPE ) { propertyValue = typedInstance . getString ( attributeInfo . name ) ; } else if ( attributeInfo . dataType ( ) == DataTypes . SHORT_TYPE ) { propertyValue = typedInstance . getShort ( attributeInfo . name ) ; } else if ( attributeInfo . dataType ( ) == DataTypes . INT_TYPE ) { propertyValue = typedInstance . getInt ( attributeInfo . name ) ; } else if ( attributeInfo . dataType ( ) == DataTypes . BIGINTEGER_TYPE ) { propertyValue = typedInstance . getBigInt ( attributeInfo . name ) ; } else if ( attributeInfo . dataType ( ) == DataTypes . BOOLEAN_TYPE ) { propertyValue = typedInstance . getBoolean ( attributeInfo . name ) ; } else if ( attributeInfo . dataType ( ) == DataTypes . BYTE_TYPE ) { propertyValue = typedInstance . getByte ( attributeInfo . name ) ; } else if ( attributeInfo . dataType ( ) == DataTypes . LONG_TYPE ) { propertyValue = typedInstance . getLong ( attributeInfo . name ) ; } else if ( attributeInfo . dataType ( ) == DataTypes . FLOAT_TYPE ) { propertyValue = typedInstance . getFloat ( attributeInfo . name ) ; } else if ( attributeInfo . dataType ( ) == DataTypes . DOUBLE_TYPE ) { propertyValue = typedInstance . getDouble ( attributeInfo . name ) ; } else if ( attributeInfo . dataType ( ) == DataTypes . BIGDECIMAL_TYPE ) { propertyValue = typedInstance . getBigDecimal ( attributeInfo . name ) ; } else if ( attributeInfo . dataType ( ) == DataTypes . DATE_TYPE ) { final Date dateVal = typedInstance . getDate ( attributeInfo . name ) ; // Convert Property value to Long while persisting
if ( dateVal != null ) { propertyValue = dateVal . getTime ( ) ; } } else if ( attributeInfo . dataType ( ) . getTypeCategory ( ) == TypeCategory . ENUM ) { if ( attrValue != null ) { propertyValue = ( ( EnumValue ) attrValue ) . value ; } } GraphHelper . setProperty ( instanceVertex , vertexPropertyName , propertyValue ) ;
|
public class Standby { /** * Creates image validation thread .
* @ param imageFile
* @ throws IOException on error , or when standby quiesce was invoked */
private void createImageValidation ( File imageFile ) throws IOException { } }
|
synchronized ( imageValidatorLock ) { InjectionHandler . processEvent ( InjectionEvent . STANDBY_VALIDATE_CREATE ) ; if ( ! running ) { // fails the checkpoint
InjectionHandler . processEvent ( InjectionEvent . STANDBY_VALIDATE_CREATE_FAIL ) ; throw new IOException ( "Standby: standby is quiescing" ) ; } imageValidator = new ImageValidator ( imageFile ) ; imageValidator . start ( ) ; }
|
public class LatentDirichletAllocation { /** * { @ inheritDoc } */
@ Override protected void _fit ( Dataframe trainingData ) { } }
|
ModelParameters modelParameters = knowledgeBase . getModelParameters ( ) ; modelParameters . setD ( trainingData . xColumnSize ( ) ) ; int d = modelParameters . getD ( ) ; TrainingParameters trainingParameters = knowledgeBase . getTrainingParameters ( ) ; // get model parameters
int k = trainingParameters . getK ( ) ; // number of topics
Map < List < Object > , Integer > topicAssignmentOfDocumentWord = modelParameters . getTopicAssignmentOfDocumentWord ( ) ; Map < List < Integer > , Integer > documentTopicCounts = modelParameters . getDocumentTopicCounts ( ) ; Map < List < Object > , Integer > topicWordCounts = modelParameters . getTopicWordCounts ( ) ; Map < Integer , Integer > documentWordCounts = modelParameters . getDocumentWordCounts ( ) ; Map < Integer , Integer > topicCounts = modelParameters . getTopicCounts ( ) ; // initialize topic assignments of each word randomly and update the counters
for ( Map . Entry < Integer , Record > e : trainingData . entries ( ) ) { Integer rId = e . getKey ( ) ; Record r = e . getValue ( ) ; Integer documentId = rId ; documentWordCounts . put ( documentId , r . getX ( ) . size ( ) ) ; for ( Map . Entry < Object , Object > entry : r . getX ( ) . entrySet ( ) ) { Object wordPosition = entry . getKey ( ) ; Object word = entry . getValue ( ) ; // sample a topic
Integer topic = PHPMethods . mt_rand ( 0 , k - 1 ) ; increase ( topicCounts , topic ) ; topicAssignmentOfDocumentWord . put ( Arrays . asList ( documentId , wordPosition ) , topic ) ; increase ( documentTopicCounts , Arrays . asList ( documentId , topic ) ) ; increase ( topicWordCounts , Arrays . asList ( topic , word ) ) ; } } double alpha = trainingParameters . getAlpha ( ) ; double beta = trainingParameters . getBeta ( ) ; int maxIterations = trainingParameters . getMaxIterations ( ) ; int iteration = 0 ; while ( iteration < maxIterations ) { logger . debug ( "Iteration {}" , iteration ) ; int changedCounter = 0 ; // collapsed gibbs sampler
for ( Map . Entry < Integer , Record > e : trainingData . entries ( ) ) { Integer rId = e . getKey ( ) ; Record r = e . getValue ( ) ; Integer documentId = rId ; AssociativeArray topicAssignments = new AssociativeArray ( ) ; for ( int j = 0 ; j < k ; ++ j ) { topicAssignments . put ( j , 0.0 ) ; } int totalWords = r . getX ( ) . size ( ) ; for ( Map . Entry < Object , Object > entry : r . getX ( ) . entrySet ( ) ) { Object wordPosition = entry . getKey ( ) ; Object word = entry . getValue ( ) ; // remove the word from the dataset
Integer topic = topicAssignmentOfDocumentWord . get ( Arrays . asList ( documentId , wordPosition ) ) ; // decrease ( documentWordCounts , documentId ) ; / / slow
decrease ( topicCounts , topic ) ; decrease ( documentTopicCounts , Arrays . asList ( documentId , topic ) ) ; decrease ( topicWordCounts , Arrays . asList ( topic , word ) ) ; // int numberOfDocumentWords = r . getX ( ) . size ( ) - 1 ; / / fast - decreased by 1
// compute the posteriors of the topics and sample from it
AssociativeArray topicProbabilities = new AssociativeArray ( ) ; for ( int j = 0 ; j < k ; ++ j ) { Integer njw = topicWordCounts . get ( Arrays . asList ( j , word ) ) ; double enumerator ; if ( njw != null ) { enumerator = njw + beta ; } else { enumerator = beta ; } Integer njd = documentTopicCounts . get ( Arrays . asList ( documentId , j ) ) ; if ( njd != null ) { enumerator *= ( njd + alpha ) ; } else { enumerator *= alpha ; } double denominator = topicCounts . get ( ( Integer ) j ) + beta * d ; // denominator * = numberOfDocumentWords + alpha * k ; / / this is not necessary because it is the same for all categories , so it can be omited
topicProbabilities . put ( j , enumerator / denominator ) ; } // normalize probabilities
// Descriptives . normalize ( topicProbabilities ) ;
// sample from these probabilieis
Integer newTopic = ( Integer ) SimpleRandomSampling . weightedSampling ( topicProbabilities , 1 , true ) . iterator ( ) . next ( ) ; topic = newTopic ; // new topic assigment
// add back the word in the dataset
topicAssignmentOfDocumentWord . put ( Arrays . asList ( documentId , wordPosition ) , topic ) ; // increase ( documentWordCounts , documentId ) ; / / slow
increase ( topicCounts , topic ) ; increase ( documentTopicCounts , Arrays . asList ( documentId , topic ) ) ; increase ( topicWordCounts , Arrays . asList ( topic , word ) ) ; topicAssignments . put ( topic , TypeInference . toDouble ( topicAssignments . get ( topic ) ) + 1.0 / totalWords ) ; } Object mainTopic = MapMethods . selectMaxKeyValue ( topicAssignments ) . getKey ( ) ; if ( ! mainTopic . equals ( r . getYPredicted ( ) ) ) { ++ changedCounter ; } trainingData . _unsafe_set ( rId , new Record ( r . getX ( ) , r . getY ( ) , mainTopic , topicAssignments ) ) ; } ++ iteration ; logger . debug ( "Reassigned Records {}" , changedCounter ) ; if ( changedCounter == 0 ) { break ; } } modelParameters . setTotalIterations ( iteration ) ;
|
public class Convolution3DUtils { /** * Get top and left padding for same mode only for 3d convolutions
* @ param outSize
* @ param inSize
* @ param kernel
* @ param strides
* @ return */
public static int [ ] get3DSameModeTopLeftPadding ( int [ ] outSize , int [ ] inSize , int [ ] kernel , int [ ] strides , int [ ] dilation ) { } }
|
int [ ] eKernel = effectiveKernelSize ( kernel , dilation ) ; int [ ] outPad = new int [ 3 ] ; outPad [ 0 ] = ( ( outSize [ 0 ] - 1 ) * strides [ 0 ] + eKernel [ 0 ] - inSize [ 0 ] ) / 2 ; outPad [ 1 ] = ( ( outSize [ 1 ] - 1 ) * strides [ 1 ] + eKernel [ 1 ] - inSize [ 1 ] ) / 2 ; outPad [ 2 ] = ( ( outSize [ 2 ] - 1 ) * strides [ 2 ] + eKernel [ 2 ] - inSize [ 2 ] ) / 2 ; return outPad ;
|
public class ResourceUtil { /** * This method will find resources as a file , resources and test / resources are found on class loader paths e . g .
* file1 . csv
* @ param resourceName resource name
* @ return < code > File < / code > resource file */
public static File getResourceFile ( String resourceName ) throws URISyntaxException , ClassNotFoundException { } }
|
URL url = ResourceUtil . class . getClassLoader ( ) . getResource ( resourceName ) ; assert url != null : resourceName ; return new File ( url . toURI ( ) ) ;
|
public class GeneratorRegistry { /** * Returns true if the generator associated to the binary resource path is
* an Image generator .
* @ param resourcePath
* the binary resource path
* @ return true if the generator associated to the binary resource path is
* an Image generator . */
public boolean isGeneratedBinaryResource ( String resourcePath ) { } }
|
boolean isGeneratedImage = false ; ResourceGenerator generator = resolveResourceGenerator ( resourcePath ) ; if ( generator != null && binaryResourceGeneratorRegistry . contains ( generator ) ) { isGeneratedImage = true ; } return isGeneratedImage ;
|
public class CronMapper { /** * Creates a Function that returns a On instance with zero value .
* @ param name - Cron field name
* @ return new CronField - > CronField instance , never null */
@ VisibleForTesting static Function < CronField , CronField > returnOnZeroExpression ( final CronFieldName name ) { } }
|
return field -> { final FieldConstraints constraints = FieldConstraintsBuilder . instance ( ) . forField ( name ) . createConstraintsInstance ( ) ; return new CronField ( name , new On ( new IntegerFieldValue ( 0 ) ) , constraints ) ; } ;
|
public class ComponentLoader { /** * do not change , method is used in flex extension */
public static ComponentImpl loadComponent ( PageContext pc , Page page , String callPath , boolean isRealPath , boolean silent , boolean isExtendedComponent , boolean executeConstr ) throws PageException { } }
|
CIPage cip = toCIPage ( page , callPath ) ; if ( silent ) { // TODO is there a more direct way
BodyContent bc = pc . pushBody ( ) ; try { return _loadComponent ( pc , cip , callPath , isRealPath , isExtendedComponent , executeConstr ) ; } finally { BodyContentUtil . clearAndPop ( pc , bc ) ; } } return _loadComponent ( pc , cip , callPath , isRealPath , isExtendedComponent , executeConstr ) ;
|
public class GoogleDriveFileSystem { /** * org . apache . hadoop . fs . Path assumes that there separator in file system naming and " / " is the separator .
* When org . apache . hadoop . fs . Path sees " / " in path String , it splits into parent and name . As fileID is a random
* String determined by Google and it can contain " / " itself , this method check if parent and name is separated and
* restore " / " back to file ID .
* @ param p
* @ return */
public static String toFileId ( Path p ) { } }
|
if ( p . isRoot ( ) ) { return "" ; } final String format = "%s" + Path . SEPARATOR + "%s" ; if ( p . getParent ( ) != null && StringUtils . isEmpty ( p . getParent ( ) . getName ( ) ) ) { return p . getName ( ) ; } return String . format ( format , toFileId ( p . getParent ( ) ) , p . getName ( ) ) ;
|
public class Middlewares { /** * Returns the default middlewares applied by Apollo to routes supplied by a { @ link RouteProvider } . */
public static Middleware < AsyncHandler < ? > , AsyncHandler < Response < ByteString > > > apolloDefaults ( ) { } }
|
return serialize ( new AutoSerializer ( ) ) . and ( Middlewares :: httpPayloadSemantics ) ;
|
public class CPOptionValuePersistenceImpl { /** * Returns the last cp option value in the ordered set where uuid = & # 63 ; and companyId = & # 63 ; .
* @ param uuid the uuid
* @ param companyId the company ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the last matching cp option value
* @ throws NoSuchCPOptionValueException if a matching cp option value could not be found */
@ Override public CPOptionValue findByUuid_C_Last ( String uuid , long companyId , OrderByComparator < CPOptionValue > orderByComparator ) throws NoSuchCPOptionValueException { } }
|
CPOptionValue cpOptionValue = fetchByUuid_C_Last ( uuid , companyId , orderByComparator ) ; if ( cpOptionValue != null ) { return cpOptionValue ; } StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "uuid=" ) ; msg . append ( uuid ) ; msg . append ( ", companyId=" ) ; msg . append ( companyId ) ; msg . append ( "}" ) ; throw new NoSuchCPOptionValueException ( msg . toString ( ) ) ;
|
public class AbstractNativeElementContext { /** * visible for testing */
protected static List < AndroidElement > searchViews ( AbstractNativeElementContext context , View root , Predicate predicate , boolean findJustOne ) { } }
|
List < AndroidElement > elements = new ArrayList < AndroidElement > ( ) ; if ( root == null ) { return elements ; } ArrayDeque < View > queue = new ArrayDeque < View > ( ) ; queue . add ( root ) ; while ( ! queue . isEmpty ( ) ) { View view = queue . pop ( ) ; if ( predicate . apply ( view ) ) { elements . add ( context . newAndroidElement ( view ) ) ; if ( findJustOne ) { break ; } } if ( view instanceof ViewGroup ) { ViewGroup group = ( ViewGroup ) view ; int childrenCount = group . getChildCount ( ) ; for ( int index = 0 ; index < childrenCount ; index ++ ) { queue . add ( group . getChildAt ( index ) ) ; } } } return elements ;
|
public class QueryParserKraken { /** * Parses the create . */
private QueryBuilderKraken parseCreate ( ) { } }
|
Token token ; // TableBuilderKraken factory = null ; / / = _ database . createTableFactory ( ) ;
if ( ( token = scanToken ( ) ) != Token . TABLE ) throw error ( "expected TABLE at '{0}'" , token ) ; if ( ( token = scanToken ( ) ) != Token . IDENTIFIER ) throw error ( "expected identifier at '{0}'" , token ) ; String name = _lexeme ; String pod = null ; while ( peekToken ( ) == Token . DOT ) { scanToken ( ) ; if ( ( token = scanToken ( ) ) != Token . IDENTIFIER ) { throw error ( "expected identifier at '{0}'" , token ) ; } if ( pod == null ) { pod = name ; } else { pod = pod + '.' + name ; } name = _lexeme ; } if ( pod == null ) { pod = getPodName ( ) ; } TableBuilderKraken factory = new TableBuilderKraken ( pod , name , _sql ) ; // factory . startTable ( _ lexeme ) ;
if ( ( token = scanToken ( ) ) != Token . LPAREN ) { throw error ( "expected '(' at '{0}'" , token ) ; } do { token = scanToken ( ) ; switch ( token ) { case IDENTIFIER : parseCreateColumn ( factory , _lexeme ) ; break ; /* case UNIQUE :
token = scanToken ( ) ;
if ( token ! = KEY ) {
_ token = token ;
factory . addUnique ( parseColumnNames ( ) ) ;
break ; */
case PRIMARY : token = scanToken ( ) ; if ( token != Token . KEY ) throw error ( "expected 'key' at {0}" , token ) ; factory . addPrimaryKey ( parseColumnNames ( ) ) ; break ; case KEY : // String key = parseIdentifier ( ) ;
factory . addPrimaryKey ( parseColumnNames ( ) ) ; // factory . addPrimaryKey ( parseColumnNames ( ) ) ;
break ; /* case CHECK :
if ( ( token = scanToken ( ) ) ! = ' ( ' )
throw error ( L . l ( " Expected ' ( ' at ' { 0 } ' " , tokenName ( token ) ) ) ;
parseExpr ( ) ;
if ( ( token = scanToken ( ) ) ! = ' ) ' )
throw error ( L . l ( " Expected ' ) ' at ' { 0 } ' " , tokenName ( token ) ) ) ;
break ; */
default : throw error ( "unexpected token '{0}'" , token ) ; } token = scanToken ( ) ; } while ( token == Token . COMMA ) ; if ( token != Token . RPAREN ) { throw error ( "expected ')' at '{0}'" , token ) ; } token = scanToken ( ) ; HashMap < String , String > propMap = new HashMap < > ( ) ; if ( token == Token . WITH ) { do { String key = parseIdentifier ( ) ; ExprKraken expr = parseExpr ( ) ; if ( ! ( expr instanceof LiteralExpr ) ) { throw error ( "WITH expression must be a literal at '{0}'" , expr ) ; } String value = expr . evalString ( null ) ; propMap . put ( key , value ) ; } while ( ( token = scanToken ( ) ) == Token . COMMA ) ; } if ( token != Token . EOF ) { throw error ( "Expected end of file at '{0}'" , token ) ; } return new CreateQueryBuilder ( _tableManager , factory , _sql , propMap ) ;
|
public class ThreadPoolController { /** * Evaluates a ThroughputDistribution for possible removal from the historical dataset .
* @ param priorStats - ThroughputDistribution under evaluation
* @ param forecast - expected throughput at the current poolSize
* @ return - true if priorStats should be removed */
private boolean pruneData ( ThroughputDistribution priorStats , double forecast ) { } }
|
boolean prune = false ; // if forecast tput is much greater or much smaller than priorStats , we suspect
// priorStats is no longer relevant , so prune it
double tputRatio = forecast / priorStats . getMovingAverage ( ) ; if ( tputRatio > tputRatioPruneLevel || tputRatio < ( 1 / tputRatioPruneLevel ) ) { prune = true ; } else { // age & reliability ( represented by standard deviation ) check
int age = controllerCycle - priorStats . getLastUpdate ( ) ; double variability = ( priorStats . getStddev ( ) / priorStats . getMovingAverage ( ) ) ; if ( age * variability > dataAgePruneLevel ) prune = true ; } return prune ;
|
public class Project { /** * TODO : we should have a central place for enum types */
public Set < EnumType > getEnumTypes ( ) { } }
|
Set < EnumType > ret = Sets . newTreeSet ( ) ; for ( Entity entity : getEntities ( ) . getList ( ) ) { for ( Attribute attribute : entity . getAttributes ( ) . getList ( ) ) { if ( attribute . isEnum ( ) ) { ret . add ( attribute . getEnumType ( ) ) ; } } } return ret ;
|
public class ResourceCollection { /** * Add a resource created within the analyzed method .
* @ param location
* the location
* @ param resource
* the resource created at that location */
public void addCreatedResource ( Location location , Resource resource ) { } }
|
resourceList . add ( resource ) ; locationToResourceMap . put ( location , resource ) ;
|
public class Api { /** * Update access mode of one or more resources by prefix
* @ param accessMode The new access mode , " public " or " authenticated "
* @ param prefix The prefix by which to filter applicable resources
* @ param options additional options
* < ul >
* < li > resource _ type - ( default " image " ) - the type of resources to modify < / li >
* < li > max _ results - optional - the maximum resources to process in a single invocation < / li >
* < li > next _ cursor - optional - provided by a previous call to the method < / li >
* < / ul >
* @ return a map of the returned values
* < ul >
* < li > updated - an array of resources < / li >
* < li > next _ cursor - optional - provided if more resources can be processed < / li >
* < / ul >
* @ throws ApiException an API exception */
public ApiResponse updateResourcesAccessModeByPrefix ( String accessMode , String prefix , Map options ) throws Exception { } }
|
return updateResourcesAccessMode ( accessMode , "prefix" , prefix , options ) ;
|
public class UpdateAccountSettingsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( UpdateAccountSettingsRequest updateAccountSettingsRequest , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( updateAccountSettingsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateAccountSettingsRequest . getAccountId ( ) , ACCOUNTID_BINDING ) ; protocolMarshaller . marshall ( updateAccountSettingsRequest . getAccountSettings ( ) , ACCOUNTSETTINGS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class PoiWorkSheet { /** * Create cell cell .
* @ param obj the obj
* @ return the cell */
public Cell createCell ( Object obj ) { } }
|
Cell cell = this . getNextCell ( CellType . STRING ) ; cell . setCellValue ( String . valueOf ( obj ) ) ; cell . setCellStyle ( this . style . getStringCs ( ) ) ; return cell ;
|
public class DifferenceCalculator { /** * This Java function computes the difference between the sum of the cubes of the first ' num ' natural numbers and the sum of these numbers .
* @ param num A natural number .
* @ return An integer that represents the difference .
* Examples :
* compute _ difference ( 3 ) returns 30
* compute _ difference ( 5 ) returns 210
* compute _ difference ( 2 ) returns 6 */
public static int computeDifference ( int num ) { } }
|
int sumNumbers = ( num * ( num + 1 ) ) / 2 ; int result = ( sumNumbers * ( sumNumbers - 1 ) ) ; return result ;
|
public class CmsLinkManager { /** * Returns a link < i > from < / i > the URI stored in the provided OpenCms user context
* < i > to < / i > the given < code > link < / code > , for use on web pages . < p >
* A number of tests are performed with the < code > link < / code > in order to find out how to create the link : < ul >
* < li > If < code > link < / code > is empty , an empty String is returned .
* < li > If < code > link < / code > starts with an URI scheme component , for example < code > http : / / < / code > ,
* and does not point to an internal OpenCms site , it is returned unchanged .
* < li > If < code > link < / code > is an absolute URI that starts with a configured site root ,
* the site root is cut from the link and
* the same result as { @ link # substituteLink ( CmsObject , String , String ) } is returned .
* < li > Otherwise the same result as { @ link # substituteLink ( CmsObject , String ) } is returned .
* < / ul >
* @ param cms the current OpenCms user context
* @ param link the link to process
* @ return a link < i > from < / i > the URI stored in the provided OpenCms user context
* < i > to < / i > the given < code > link < / code > */
public String substituteLinkForUnknownTarget ( CmsObject cms , String link ) { } }
|
return substituteLinkForUnknownTarget ( cms , link , false ) ;
|
public class CSSModuleBuilder { /** * Replace < code > url ( & lt ; < i > relative - path < / i > & gt ; ) < / code > references in the
* input CSS with
* < code > url ( data : & lt ; < i > mime - type < / i > & gt ; ; & lt ; < i > base64 - encoded - data < / i > & gt ; < / code >
* ) . The conversion is controlled by option settings as described in
* { @ link CSSModuleBuilder } .
* @ param req
* The request associated with the call .
* @ param css
* The input CSS
* @ param res
* The resource for the CSS file
* @ return The transformed CSS with images in - lined as determined by option
* settings . */
protected String inlineImageUrls ( HttpServletRequest req , String css , IResource res ) { } }
|
if ( imageSizeThreshold == 0 && inlinedImageIncludeList . size ( ) == 0 ) { // nothing to do
return css ; } // In - lining of imports can be disabled by request parameter for debugging
if ( ! TypeUtil . asBoolean ( req . getParameter ( INLINEIMAGES_REQPARAM_NAME ) , true ) ) { return css ; } StringBuffer buf = new StringBuffer ( ) ; Matcher m = urlPattern . matcher ( css ) ; while ( m . find ( ) ) { String fullMatch = m . group ( 0 ) ; String urlMatch = m . group ( 1 ) ; // remove quotes .
urlMatch = dequote ( urlMatch ) ; urlMatch = forwardSlashPattern . matcher ( urlMatch ) . replaceAll ( "/" ) ; // $ NON - NLS - 1 $
// Don ' t do anything with non - relative URLs
if ( urlMatch . startsWith ( "/" ) || urlMatch . startsWith ( "#" ) || protocolPattern . matcher ( urlMatch ) . find ( ) ) { // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $
m . appendReplacement ( buf , BLANK ) ; buf . append ( fullMatch ) ; continue ; } URI imageUri = null ; // Catch IllegalArgumentExceptions when trying to resolve the match URL in case
// parsing of the URL failed and gave us a malformed URL .
try { imageUri = res . resolve ( urlMatch ) ; } catch ( IllegalArgumentException ignore ) { m . appendReplacement ( buf , BLANK ) ; buf . append ( fullMatch ) ; continue ; } boolean exclude = false , include = false ; // Determine if this image is in the include list
for ( Pattern regex : inlinedImageIncludeList ) { if ( regex . matcher ( imageUri . getPath ( ) ) . find ( ) ) { include = true ; break ; } } // Determine if this image is in the exclude list
for ( Pattern regex : inlinedImageExcludeList ) { if ( regex . matcher ( imageUri . getPath ( ) ) . find ( ) ) { exclude = true ; break ; } } // If there ' s an include list , then only the files in the include list
// will be inlined
if ( inlinedImageIncludeList . size ( ) > 0 && ! include || exclude ) { m . appendReplacement ( buf , BLANK ) ; buf . append ( fullMatch ) ; continue ; } boolean imageInlined = false ; String type = URLConnection . getFileNameMap ( ) . getContentTypeFor ( imageUri . getPath ( ) ) ; String extension = PathUtil . getExtension ( imageUri . getPath ( ) ) ; if ( type == null ) { type = inlineableImageTypeMap . get ( extension ) ; } if ( type == null ) { type = "content/unknown" ; // $ NON - NLS - 1 $
} if ( include || inlineableImageTypes . contains ( type ) || inlineableImageTypeMap . containsKey ( extension ) ) { InputStream in = null ; try { // In - line the image .
IResource imageRes = aggregator . newResource ( imageUri ) ; if ( ! imageRes . exists ( ) ) { throw new NotFoundException ( imageUri . toString ( ) ) ; } if ( include || imageRes . getSize ( ) <= imageSizeThreshold ) { String base64 = getBase64 ( imageRes . getInputStream ( ) ) ; m . appendReplacement ( buf , BLANK ) ; buf . append ( "url('data:" + type + // $ NON - NLS - 1 $
";base64," + base64 + "')" ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $
imageInlined = true ; } } catch ( IOException ex ) { if ( log . isLoggable ( Level . WARNING ) ) { log . log ( Level . WARNING , MessageFormat . format ( Messages . CSSModuleBuilder_0 , new Object [ ] { imageUri } ) , ex ) ; } } finally { if ( in != null ) { try { in . close ( ) ; } catch ( IOException ignore ) { } } } } if ( ! imageInlined ) { // Image not in - lined . Write the original URL
m . appendReplacement ( buf , BLANK ) ; buf . append ( fullMatch ) ; } } m . appendTail ( buf ) ; return buf . toString ( ) ;
|
public class LayerCacheImpl { /** * / * ( non - Javadoc )
* @ see com . ibm . jaggr . service . layer . ILayerCache # dump ( java . io . Writer , java . util . regex . Pattern ) */
@ Override public void dump ( Writer writer , Pattern filter ) throws IOException { } }
|
String linesep = System . getProperty ( "line.separator" ) ; // $ NON - NLS - 1 $
for ( Map . Entry < String , ILayer > entry : cacheMap . entrySet ( ) ) { if ( filter != null ) { Matcher m = filter . matcher ( entry . getKey ( ) ) ; if ( ! m . find ( ) ) continue ; } writer . append ( "ILayer key: " ) . append ( entry . getKey ( ) ) . append ( linesep ) ; // $ NON - NLS - 1 $
writer . append ( entry . getValue ( ) . toString ( ) ) . append ( linesep ) . append ( linesep ) ; } writer . append ( "Number of layer cache entires = " ) . append ( Integer . toString ( cacheMap . size ( ) ) ) . append ( linesep ) ; // $ NON - NLS - 1 $
writer . append ( "Number of layer cache evictions = " ) . append ( Integer . toString ( numEvictions . get ( ) ) ) . append ( linesep ) ; // $ NON - NLS - 1 $
|
public class ElementImpl { /** * { @ inheritDoc } */
public Attr getAttributeNode ( String name ) { } }
|
return ( attributes == null ) ? null : ( Attr ) ( attributes . getNamedItem ( name ) ) ;
|
public class NewChunk { /** * Slow - path append string */
private void append2slowstr ( ) { } }
|
// In case of all NAs and then a string , convert NAs to string NAs
if ( _xs != null ) { _xs = null ; _ms = null ; alloc_str_indices ( _sparseLen ) ; Arrays . fill ( _is , - 1 ) ; } if ( _is != null && _is . length > 0 ) { // Check for sparseness
if ( _id == null ) { int nzs = 0 ; // assume one non - null for the element currently being stored
for ( int i : _is ) if ( i != - 1 ) ++ nzs ; if ( ( nzs + 1 ) * _sparseRatio < _len ) set_sparse ( nzs , Compress . NA ) ; } else { if ( ( _sparseRatio * ( _sparseLen ) >> 2 ) > _len ) cancel_sparse ( ) ; else _id = MemoryManager . arrayCopyOf ( _id , _sparseLen << 1 ) ; } _is = MemoryManager . arrayCopyOf ( _is , _sparseLen << 1 ) ; /* initialize the memory extension with - 1s */
for ( int i = _sparseLen ; i < _is . length ; i ++ ) _is [ i ] = - 1 ; } else { _is = MemoryManager . malloc4 ( 4 ) ; /* initialize everything with - 1s */
for ( int i = 0 ; i < _is . length ; i ++ ) _is [ i ] = - 1 ; if ( sparseZero ( ) || sparseNA ( ) ) alloc_indices ( 4 ) ; } assert _sparseLen == 0 || _is . length > _sparseLen : "_ls.length = " + _is . length + ", _len = " + _sparseLen ;
|
public class StatefulKnowledgeSessionImpl { /** * This class is not thread safe , changes to the working memory during
* iteration may give unexpected results */
public Iterator iterateObjects ( org . kie . api . runtime . ObjectFilter filter ) { } }
|
return getObjectStore ( ) . iterateObjects ( filter ) ;
|
public class NativeSystemCall { /** * Execute a native system command as if it were run from the given path .
* @ param command the system command to execute
* @ param parms the command parameters
* @ param out a print writer to which command output will be streamed
* @ param path the path from which to execute the command
* @ return 0 on successful completion , any other return code denotes failure */
public static int execFromPath ( final String command , final String [ ] parms , final OutputStream out , final DirectoryResource path ) throws IOException { } }
|
Assert . notNull ( command , "Command must not be null." ) ; Assert . notNull ( path , "Directory path must not be null." ) ; Assert . notNull ( out , "OutputStream must not be null." ) ; try { String [ ] commandTokens = parms == null ? new String [ 1 ] : new String [ parms . length + 1 ] ; commandTokens [ 0 ] = command ; if ( commandTokens . length > 1 ) { System . arraycopy ( parms , 0 , commandTokens , 1 , parms . length ) ; } ProcessBuilder builder = new ProcessBuilder ( commandTokens ) ; builder . directory ( path . getUnderlyingResourceObject ( ) ) ; builder . redirectErrorStream ( true ) ; Process p = builder . start ( ) ; InputStream stdout = p . getInputStream ( ) ; Thread outThread = new Thread ( new Receiver ( stdout , out ) ) ; outThread . start ( ) ; outThread . join ( ) ; return p . waitFor ( ) ; } catch ( InterruptedException e ) { e . printStackTrace ( ) ; return - 1 ; }
|
public class ModelsImpl { /** * Update an entity role for a given entity .
* @ param appId The application ID .
* @ param versionId The version ID .
* @ param cEntityId The composite entity extractor ID .
* @ param roleId The entity role ID .
* @ param updateCompositeEntityRoleOptionalParameter the object representing the optional parameters to be set before calling this API
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < OperationStatus > updateCompositeEntityRoleAsync ( UUID appId , String versionId , UUID cEntityId , UUID roleId , UpdateCompositeEntityRoleOptionalParameter updateCompositeEntityRoleOptionalParameter , final ServiceCallback < OperationStatus > serviceCallback ) { } }
|
return ServiceFuture . fromResponse ( updateCompositeEntityRoleWithServiceResponseAsync ( appId , versionId , cEntityId , roleId , updateCompositeEntityRoleOptionalParameter ) , serviceCallback ) ;
|
public class BusinessProcess { /** * Associate with the provided execution . This starts a unit of work .
* @ param executionId
* the id of the execution to associate with .
* @ throw ProcessEngineCdiException
* if no such execution exists */
public void associateExecutionById ( String executionId ) { } }
|
Execution execution = processEngine . getRuntimeService ( ) . createExecutionQuery ( ) . executionId ( executionId ) . singleResult ( ) ; if ( execution == null ) { throw new ProcessEngineCdiException ( "Cannot associate execution by id: no execution with id '" + executionId + "' found." ) ; } associationManager . setExecution ( execution ) ;
|
public class GroupBy { /** * Create a new aggregating min expression
* @ param expression expression for which the minimum value will be used in the group by projection
* @ return wrapper expression */
public static < E extends Comparable < ? super E > > AbstractGroupExpression < E , E > min ( Expression < E > expression ) { } }
|
return new GMin < E > ( expression ) ;
|
public class XMLUtils { /** * Removes leading XML declaration from xml if present .
* @ param xml
* @ return */
public static String omitXmlDeclaration ( String xml ) { } }
|
if ( xml . startsWith ( "<?xml" ) && xml . contains ( "?>" ) ) { return xml . substring ( xml . indexOf ( "?>" ) + 2 ) . trim ( ) ; } return xml ;
|
public class AbstractQuotaPersister { /** * { @ inheritDoc } */
public boolean isNodeQuotaOrGroupOfNodesQuotaAsync ( String repositoryName , String workspaceName , String nodePath ) throws UnknownQuotaLimitException { } }
|
try { return isNodeQuotaAsync ( repositoryName , workspaceName , nodePath ) ; } catch ( UnknownQuotaLimitException e ) { String patternPath = getAcceptableGroupOfNodesQuota ( repositoryName , workspaceName , nodePath ) ; if ( patternPath != null ) { return isGroupOfNodesQuotaAsync ( repositoryName , workspaceName , patternPath ) ; } throw new UnknownQuotaLimitException ( "Quota for " + nodePath + " is not defined" ) ; }
|
public class ResourceServerEntity { /** * Creates request for delete resource server by it ' s ID
* See < a href = https : / / auth0 . com / docs / api / management / v2 # ! / Resource _ Servers / delete _ resource _ servers _ by _ id > API documentation < / a >
* @ param resourceServerId { @ link ResourceServer # id } field
* @ return request to execute */
public Request < Void > delete ( String resourceServerId ) { } }
|
Asserts . assertNotNull ( resourceServerId , "Resource server ID" ) ; HttpUrl . Builder builder = baseUrl . newBuilder ( ) . addPathSegments ( "api/v2/resource-servers" ) . addPathSegment ( resourceServerId ) ; String url = builder . build ( ) . toString ( ) ; VoidRequest request = new VoidRequest ( client , url , "DELETE" ) ; request . addHeader ( "Authorization" , "Bearer " + apiToken ) ; return request ;
|
public class Boot { /** * Add a JVM shutdown hook . */
public Boot addShutdownHook ( ) { } }
|
Runtime . getRuntime ( ) . addShutdownHook ( new Thread ( ) { @ Override public void run ( ) { Boot . this . stop ( ) ; } } ) ; return this ;
|
public class BDXImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } }
|
switch ( featureID ) { case AfplibPackage . BDX__DMX_NAME : return getDMXName ( ) ; } return super . eGet ( featureID , resolve , coreType ) ;
|
public class QueryTreeNode { /** * Evaluate the query directly on a byte buffer rather than on materialized objects .
* @ param pos position in byte buffer
* @ param dds DataDeSerializer
* @ return Whether the object is a match . */
public boolean evaluate ( DataDeSerializerNoClass dds , long pos ) { } }
|
boolean first = ( n1 != null ? n1 . evaluate ( dds , pos ) : t1 . evaluate ( dds , pos ) ) ; // do we have a second part ?
if ( op == null ) { return first ; } if ( ! first && op == LOG_OP . AND ) { return false ; } if ( first && op == LOG_OP . OR ) { return true ; } return ( n2 != null ? n2 . evaluate ( dds , pos ) : t2 . evaluate ( dds , pos ) ) ;
|
public class SDMath { /** * Index of the min absolute value : argmin ( abs ( in ) )
* @ see SameDiff # argmin ( String , SDVariable , boolean , int . . . ) */
public SDVariable iamin ( String name , SDVariable in , int ... dimensions ) { } }
|
return iamin ( name , in , false , dimensions ) ;
|
public class ClassFileMetaData { /** * Checks if the constant pool contains the provided int constant , which implies the constant is used somewhere in the code .
* NB : compile - time constant expressions are evaluated at compile time . */
public boolean containsInteger ( int value ) { } }
|
for ( int i = 1 ; i < maxPoolSize ; i ++ ) { if ( types [ i ] == INTEGER && readInteger ( i ) == value ) return true ; } return false ;
|
public class Vector4f { /** * Read this vector from the supplied { @ link ByteBuffer } starting at the specified
* absolute buffer position / index .
* This method will not increment the position of the given ByteBuffer .
* @ param index
* the absolute position into the ByteBuffer
* @ param buffer
* values will be read in < code > x , y , z , w < / code > order
* @ return this */
public Vector4f set ( int index , ByteBuffer buffer ) { } }
|
MemUtil . INSTANCE . get ( this , index , buffer ) ; return this ;
|
public class CmsAccountInfo { /** * Returns the account info value for the given user . < p >
* @ param user the user
* @ return the value */
public String getValue ( CmsUser user ) { } }
|
String value = null ; if ( isAdditionalInfo ( ) ) { value = ( String ) user . getAdditionalInfo ( getAddInfoKey ( ) ) ; } else { try { PropertyUtilsBean propUtils = new PropertyUtilsBean ( ) ; value = ( String ) propUtils . getProperty ( user , getField ( ) . name ( ) ) ; } catch ( IllegalAccessException | InvocationTargetException | NoSuchMethodException e ) { LOG . error ( "Error reading account info field." , e ) ; } } return value ;
|
public class FeatureCallAsTypeLiteralHelper { /** * / * @ Nullable */
public List < String > getTypeNameSegmentsFromConcreteSyntax ( XMemberFeatureCall featureCall ) { } }
|
List < INode > nodes = NodeModelUtils . findNodesForFeature ( featureCall , XbasePackage . Literals . XMEMBER_FEATURE_CALL__MEMBER_CALL_TARGET ) ; List < String > prefix = getTypeNameSegmentsFromConcreteSyntax ( nodes , featureCall . isExplicitStatic ( ) ) ; return prefix ;
|
public class MediaApi { /** * Create the interaction in UCS database
* Create the interaction in UCS database
* @ param mediatype media - type of interaction ( required )
* @ param id id of the interaction ( required )
* @ param addContentData ( optional )
* @ return ApiResponse & lt ; ApiSuccessResponse & gt ;
* @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */
public ApiResponse < ApiSuccessResponse > addContentWithHttpInfo ( String mediatype , String id , AddContentData addContentData ) throws ApiException { } }
|
com . squareup . okhttp . Call call = addContentValidateBeforeCall ( mediatype , id , addContentData , null , null ) ; Type localVarReturnType = new TypeToken < ApiSuccessResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
|
public class dnsaction64 { /** * Use this API to unset the properties of dnsaction64 resources .
* Properties that need to be unset are specified in args array . */
public static base_responses unset ( nitro_service client , dnsaction64 resources [ ] , String [ ] args ) throws Exception { } }
|
base_responses result = null ; if ( resources != null && resources . length > 0 ) { dnsaction64 unsetresources [ ] = new dnsaction64 [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { unsetresources [ i ] = new dnsaction64 ( ) ; unsetresources [ i ] . actionname = resources [ i ] . actionname ; } result = unset_bulk_request ( client , unsetresources , args ) ; } return result ;
|
public class SchemaTool { /** * Prepare the Table descriptor for the given entity Schema */
private HTableDescriptor prepareTableDescriptor ( String tableName , String entitySchemaString ) { } }
|
HTableDescriptor descriptor = new HTableDescriptor ( Bytes . toBytes ( tableName ) ) ; AvroEntitySchema entitySchema = parser . parseEntitySchema ( entitySchemaString ) ; Set < String > familiesToAdd = entitySchema . getColumnMappingDescriptor ( ) . getRequiredColumnFamilies ( ) ; familiesToAdd . add ( new String ( Constants . SYS_COL_FAMILY ) ) ; familiesToAdd . add ( new String ( Constants . OBSERVABLE_COL_FAMILY ) ) ; for ( String familyToAdd : familiesToAdd ) { if ( ! descriptor . hasFamily ( familyToAdd . getBytes ( ) ) ) { descriptor . addFamily ( new HColumnDescriptor ( familyToAdd ) ) ; } } return descriptor ;
|
public class ExampleOneClientModule { /** * Overriding the default BeadledomClientConfiguration */
@ Provides @ ResourceOneFeature BeadledomClientConfiguration provideClientConfig ( ) { } }
|
return BeadledomClientConfiguration . builder ( ) . maxPooledPerRouteSize ( 60 ) . socketTimeoutMillis ( 60 ) . connectionTimeoutMillis ( 60 ) . ttlMillis ( 60 ) . connectionPoolSize ( 60 ) . build ( ) ;
|
public class LBiObjIntFunctionBuilder { /** * One of ways of creating builder . This might be the only way ( considering all _ functional _ builders ) that might be utilize to specify generic params only once . */
@ Nonnull public static < T1 , T2 , R > LBiObjIntFunctionBuilder < T1 , T2 , R > biObjIntFunction ( Consumer < LBiObjIntFunction < T1 , T2 , R > > consumer ) { } }
|
return new LBiObjIntFunctionBuilder ( consumer ) ;
|
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link Object } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link Object } { @ code > } */
@ XmlElementDecl ( namespace = "http://www.opengis.net/citygml/1.0" , name = "_GenericApplicationPropertyOfSite" ) public JAXBElement < Object > create_GenericApplicationPropertyOfSite ( Object value ) { } }
|
return new JAXBElement < Object > ( __GenericApplicationPropertyOfSite_QNAME , Object . class , null , value ) ;
|
public class AponReader { /** * Converts to a Parameters object from a character - input stream .
* @ param reader the character - input stream
* @ return the Parameters object
* @ throws AponParseException if reading APON format document fails */
public static Parameters parse ( Reader reader ) throws AponParseException { } }
|
if ( reader == null ) { throw new IllegalArgumentException ( "reader must not be null" ) ; } AponReader aponReader = new AponReader ( reader ) ; return aponReader . read ( ) ;
|
public class Util { /** * Sets a blob parameter for the prepared statement .
* @ param ps
* @ param i
* @ param o
* @ param cls
* @ throws SQLException */
private static void setBlob ( PreparedStatement ps , int i , Object o , Class < ? > cls ) throws SQLException { } }
|
final InputStream is ; if ( o instanceof byte [ ] ) { is = new ByteArrayInputStream ( ( byte [ ] ) o ) ;
|
public class NumberUtil { /** * 提供 ( 相对 ) 精确的除法运算 , 当发生除不尽的情况的时候 , 精确到小数点后10位 , 后面的四舍五入
* @ param v1 被除数
* @ param v2 除数
* @ return 两个参数的商 */
public static BigDecimal div ( String v1 , String v2 ) { } }
|
return div ( v1 , v2 , DEFAUT_DIV_SCALE ) ;
|
public class NBTMapper { /** * Takes in an NBT tag , sanely checks null status , and then returns it value . This method will return null if the value cannot be cast to the given class .
* @ param t Tag to get the value from
* @ param clazz the return type to use
* @ return the value as an onbject of the same type as the given class */
public static < T > T getTagValue ( Tag < ? > t , Class < ? extends T > clazz ) { } }
|
Object o = toTagValue ( t ) ; if ( o == null ) { return null ; } try { return clazz . cast ( o ) ; } catch ( ClassCastException e ) { return null ; }
|
public class SequenceTools { /** * Cyclically permute the characters in { @ code string } < em > forward < / em > by { @ code n } elements .
* @ param string The string to permute
* @ param n The number of characters to permute by ; can be positive or negative ; values greater than the length of the array are acceptable */
public static String permuteCyclic ( String string , int n ) { } }
|
// single letters are char [ ] ; full names are Character [ ]
Character [ ] permuted = new Character [ string . length ( ) ] ; char [ ] c = string . toCharArray ( ) ; Character [ ] charArray = new Character [ c . length ] ; for ( int i = 0 ; i < c . length ; i ++ ) { charArray [ i ] = c [ i ] ; } permuteCyclic ( charArray , permuted , n ) ; char [ ] p = new char [ permuted . length ] ; for ( int i = 0 ; i < p . length ; i ++ ) { p [ i ] = permuted [ i ] ; } return String . valueOf ( p ) ;
|
public class A_CmsListTab { /** * Generates a button to create new external link resources . < p >
* @ param parentPath the parent folder site path
* @ return the button widget */
protected CmsPushButton createNewExternalLinkButton ( final String parentPath ) { } }
|
final CmsResourceTypeBean typeInfo = getTabHandler ( ) . getTypeInfo ( CmsEditExternalLinkDialog . POINTER_RESOURCE_TYPE_NAME ) ; CmsPushButton createNewButton = null ; if ( typeInfo != null ) { createNewButton = new CmsPushButton ( I_CmsButton . ADD_SMALL ) ; createNewButton . setTitle ( org . opencms . gwt . client . Messages . get ( ) . key ( org . opencms . gwt . client . Messages . GUI_CREATE_NEW_LINK_DIALOG_TITLE_0 ) ) ; createNewButton . setButtonStyle ( ButtonStyle . FONT_ICON , null ) ; createNewButton . addClickHandler ( new ClickHandler ( ) { public void onClick ( ClickEvent event ) { CmsEditExternalLinkDialog dialog = CmsEditExternalLinkDialog . showNewLinkDialog ( typeInfo , parentPath ) ; dialog . addCloseHandler ( new CloseHandler < PopupPanel > ( ) { public void onClose ( CloseEvent < PopupPanel > closeEvent ) { getTabHandler ( ) . updateIndex ( ) ; } } ) ; } } ) ; } return createNewButton ;
|
public class HttpPostEmitter { /** * Called from { @ link Batch } only once for each Batch in existence . */
void onSealExclusive ( Batch batch , long elapsedTimeMillis ) { } }
|
try { doOnSealExclusive ( batch , elapsedTimeMillis ) ; } catch ( Throwable t ) { try { if ( ! concurrentBatch . compareAndSet ( batch , batch . batchNumber ) ) { log . error ( "Unexpected failure to set currentBatch to the failed Batch.batchNumber" ) ; } log . error ( t , "Serious error during onSealExclusive(), set currentBatch to the failed Batch.batchNumber" ) ; } catch ( Throwable t2 ) { t . addSuppressed ( t2 ) ; } throw t ; }
|
public class WSJobRepositoryImpl { /** * { @ inheritDoc } */
@ Override public List < WSJobInstance > getJobInstances ( IJPAQueryHelper queryHelper , int page , int pageSize ) throws NoSuchJobExecutionException , JobSecurityException { } }
|
if ( authService == null || authService . isAdmin ( ) || authService . isMonitor ( ) ) { return new ArrayList < WSJobInstance > ( persistenceManagerService . getJobInstances ( queryHelper , page , pageSize ) ) ; } else if ( authService . isGroupAdmin ( ) || authService . isGroupMonitor ( ) ) { queryHelper . setGroups ( authService . getGroupsForSubject ( ) ) ; queryHelper . setQueryIssuer ( authService . getRunAsUser ( ) ) ; return new ArrayList < WSJobInstance > ( persistenceManagerService . getJobInstances ( queryHelper , page , pageSize ) ) ; } else if ( authService . isSubmitter ( ) ) { queryHelper . setQueryIssuer ( authService . getRunAsUser ( ) ) ; return new ArrayList < WSJobInstance > ( persistenceManagerService . getJobInstances ( queryHelper , page , pageSize ) ) ; } throw new JobSecurityException ( "The current user " + batchSecurityHelper . getRunAsUser ( ) + " is not authorized to perform any batch operations." ) ;
|
public class ServerOperations { /** * Creates an address from the consecutive pairs . If there is an odd number of arguments the last argument will be
* a wildcard ( { @ code * } ) .
* @ param pairs the name / value pairs to create the address for
* @ return the address for the arguments */
public static ModelNode createAddress ( final String ... pairs ) { } }
|
final ModelNode address = new ModelNode ( ) . setEmptyList ( ) ; final int len = pairs . length ; for ( int i = 0 ; i < len ; i ++ ) { final String key = pairs [ i ] ; final String name = ( ++ i < len ) ? pairs [ i ] : "*" ; address . add ( key , name ) ; } return address ;
|
public class DatabasesInner { /** * Exports a database .
* @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal .
* @ param serverName The name of the server .
* @ param databaseName The name of the database .
* @ param parameters The database export request parameters .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < ImportExportOperationResultInner > beginExportAsync ( String resourceGroupName , String serverName , String databaseName , ImportExportDatabaseDefinition parameters , final ServiceCallback < ImportExportOperationResultInner > serviceCallback ) { } }
|
return ServiceFuture . fromResponse ( beginExportWithServiceResponseAsync ( resourceGroupName , serverName , databaseName , parameters ) , serviceCallback ) ;
|
public class ResourceLoader { /** * Get the contents of a URL as a String
* @ param requestingClass the java . lang . Class object of the class that is attempting to load the
* resource
* @ param resource a String describing the full or partial URL of the resource whose contents to
* load
* @ return the actual contents of the resource as a String
* @ throws ResourceMissingException
* @ throws java . io . IOException */
public static String getResourceAsString ( Class < ? > requestingClass , String resource ) throws ResourceMissingException , IOException { } }
|
String line = null ; BufferedReader in = null ; StringBuffer sbText = null ; try { in = new BufferedReader ( new InputStreamReader ( getResourceAsStream ( requestingClass , resource ) , UTF_8 ) ) ; sbText = new StringBuffer ( 1024 ) ; while ( ( line = in . readLine ( ) ) != null ) sbText . append ( line ) . append ( "\n" ) ; } finally { if ( in != null ) in . close ( ) ; } return sbText . toString ( ) ;
|
public class Main { /** * input from command line
* @ return Definition definition from input
* @ throws IOException ioException */
private static Definition inputFromCommandLine ( ) throws IOException { } }
|
BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; Definition def = new Definition ( ) ; Set < String > classes = new HashSet < String > ( ) ; // profile version
String version ; do { System . out . print ( rb . getString ( "profile.version" ) + " " + rb . getString ( "profile.version.values" ) + " [1.7]: " ) ; version = in . readLine ( ) ; if ( version == null || version . equals ( "" ) ) version = "1.7" ; } while ( ! ( version . equals ( "1.7" ) || version . equals ( "1.6" ) || version . equals ( "1.5" ) || version . equals ( "1.0" ) ) ) ; def . setVersion ( version ) ; // by default , support outbound , but not inbound
def . setSupportOutbound ( true ) ; def . setSupportInbound ( false ) ; // bound
if ( ! version . equals ( "1.0" ) ) { System . out . print ( rb . getString ( "support.bound" ) + " " + rb . getString ( "support.bound.values" ) + " [O]: " ) ; String bound = in . readLine ( ) ; if ( bound == null || bound . equals ( "" ) || bound . equals ( "O" ) || bound . equals ( "o" ) || bound . equals ( "Outbound" ) ) { // keep default bound
} else if ( bound . equals ( "I" ) || bound . equals ( "i" ) || bound . equals ( "Inbound" ) ) { def . setSupportOutbound ( false ) ; def . setSupportInbound ( true ) ; } else if ( bound . equals ( "B" ) || bound . equals ( "b" ) || bound . equals ( "Bidirectional" ) ) { def . setSupportOutbound ( true ) ; def . setSupportInbound ( true ) ; } } // package name
String packageName ; do { System . out . print ( rb . getString ( "package.name" ) + ": " ) ; packageName = in . readLine ( ) ; if ( packageName . contains ( "." ) && Pattern . matches ( PACKAGE_NAME_PATTERN , packageName ) ) break ; System . out . println ( rb . getString ( "package.name.validated" ) ) ; } while ( true ) ; def . setRaPackage ( packageName ) ; // transaction
if ( def . isSupportOutbound ( ) ) { System . out . print ( rb . getString ( "support.transaction" ) + " " + rb . getString ( "support.transaction.values" ) + " [N]: " ) ; String trans = in . readLine ( ) ; if ( trans == null || trans . equals ( "" ) ) def . setSupportTransaction ( "NoTransaction" ) ; else if ( trans . equals ( "L" ) || trans . equals ( "l" ) || trans . equals ( "LocalTransaction" ) ) { def . setSupportTransaction ( "LocalTransaction" ) ; } else if ( trans . equals ( "X" ) || trans . equals ( "x" ) || trans . equals ( "XATransaction" ) ) { def . setSupportTransaction ( "XATransaction" ) ; } else { def . setSupportTransaction ( "NoTransaction" ) ; } } // reauthentication
if ( def . isSupportOutbound ( ) && ! version . equals ( "1.0" ) ) { System . out . print ( rb . getString ( "support.reauthentication" ) + " " + rb . getString ( "yesno" ) + " [N]: " ) ; String reauth = in . readLine ( ) ; if ( reauth == null || reauth . equals ( "" ) ) def . setSupportReauthen ( false ) ; else if ( reauth . equals ( "Y" ) || reauth . equals ( "y" ) || reauth . equals ( "Yes" ) ) { def . setSupportReauthen ( true ) ; } else { def . setSupportReauthen ( false ) ; } } // support annotation
if ( version . equals ( "1.7" ) || version . equals ( "1.6" ) ) { System . out . print ( rb . getString ( "use.annotation" ) + " " + rb . getString ( "yesno" ) + " [Y]: " ) ; String useAnnotation = in . readLine ( ) ; if ( useAnnotation == null ) def . setUseAnnotation ( true ) ; else { if ( useAnnotation . equals ( "N" ) || useAnnotation . equals ( "n" ) || useAnnotation . equals ( "No" ) ) def . setUseAnnotation ( false ) ; else def . setUseAnnotation ( true ) ; } } else { def . setUseAnnotation ( false ) ; } // use resource adapter
if ( def . isSupportOutbound ( ) && ! def . isSupportInbound ( ) && ( version . equals ( "1.7" ) || version . equals ( "1.6" ) || version . equals ( "1.5" ) ) ) { System . out . print ( rb . getString ( "use.ra" ) + " " + rb . getString ( "yesno" ) + " [Y]: " ) ; String useRa = in . readLine ( ) ; if ( useRa == null ) def . setUseRa ( true ) ; else { if ( useRa . equals ( "N" ) || useRa . equals ( "n" ) || useRa . equals ( "No" ) ) def . setUseRa ( false ) ; else def . setUseRa ( true ) ; } } else if ( version . equals ( "1.0" ) ) { def . setUseRa ( false ) ; } else { def . setUseRa ( true ) ; } // input ra class name
if ( def . isUseRa ( ) || def . isSupportInbound ( ) ) { String raClassName ; do { System . out . print ( rb . getString ( "ra.class.name" ) ) ; System . out . print ( " [" + def . getRaClass ( ) + "]: " ) ; raClassName = in . readLine ( ) ; if ( raClassName != null && ! raClassName . equals ( "" ) ) { if ( ! Pattern . matches ( CLASS_NAME_PATTERN , raClassName ) ) { System . out . println ( rb . getString ( "class.name.validated" ) ) ; continue ; } def . setRaClass ( raClassName ) ; classes . add ( raClassName ) ; setDefaultValue ( def , raClassName , "ResourceAdapter" ) ; setDefaultValue ( def , raClassName , "Ra" ) ; } break ; } while ( true ) ; System . out . print ( rb . getString ( "ra.serial" ) + " " + rb . getString ( "yesno" ) + " [Y]: " ) ; String raSerial = in . readLine ( ) ; if ( raSerial == null ) def . setRaSerial ( true ) ; else { if ( raSerial . equals ( "N" ) || raSerial . equals ( "n" ) || raSerial . equals ( "No" ) ) def . setRaSerial ( false ) ; else def . setRaSerial ( true ) ; } List < ConfigPropType > raProps = inputProperties ( "ra" , in , false ) ; def . setRaConfigProps ( raProps ) ; } // outbound
if ( def . isSupportOutbound ( ) ) { List < McfDef > mcfDefs = new ArrayList < > ( ) ; def . setMcfDefs ( mcfDefs ) ; int mcfID = 1 ; boolean moreMcf ; do { McfDef mcfdef = new McfDef ( mcfID , def ) ; String mcfClassName = "" ; do { System . out . print ( rb . getString ( "mcf.class.name" ) ) ; System . out . print ( " [" + mcfdef . getMcfClass ( ) + "]: " ) ; mcfClassName = in . readLine ( ) ; if ( ! mcfClassName . equals ( "" ) && ! Pattern . matches ( CLASS_NAME_PATTERN , mcfClassName ) ) { System . out . println ( rb . getString ( "class.name.validated" ) ) ; } } while ( ( classes . contains ( mcfClassName ) || ! Pattern . matches ( CLASS_NAME_PATTERN , mcfClassName ) ) && ! mcfClassName . equals ( "" ) ) ; classes . add ( mcfClassName ) ; if ( ! mcfClassName . equals ( "" ) ) { mcfdef . setMcfClass ( mcfClassName ) ; setDefaultValue ( def , mcfClassName , "ManagedConnectionFactory" ) ; setDefaultValue ( def , mcfClassName , "Mcf" ) ; } List < ConfigPropType > mcfProps = inputProperties ( "mcf" , in , false ) ; mcfdef . setMcfConfigProps ( mcfProps ) ; if ( def . isUseRa ( ) ) { System . out . print ( rb . getString ( "mcf.impl.raa" ) + " " + rb . getString ( "yesno" ) + " [Y]: " ) ; String raAssociation = in . readLine ( ) ; if ( raAssociation == null || raAssociation . equals ( "" ) ) mcfdef . setImplRaAssociation ( true ) ; else { if ( raAssociation . equals ( "Y" ) || raAssociation . equals ( "y" ) || raAssociation . equals ( "Yes" ) ) mcfdef . setImplRaAssociation ( true ) ; else mcfdef . setImplRaAssociation ( false ) ; } } String mcClassName = "" ; do { System . out . print ( rb . getString ( "mc.class.name" ) ) ; System . out . print ( " [" + mcfdef . getMcClass ( ) + "]: " ) ; mcClassName = in . readLine ( ) ; if ( ! mcClassName . equals ( "" ) && ! Pattern . matches ( CLASS_NAME_PATTERN , mcClassName ) ) { System . out . println ( rb . getString ( "class.name.validated" ) ) ; } } while ( ( classes . contains ( mcClassName ) || ! Pattern . matches ( CLASS_NAME_PATTERN , mcClassName ) ) && ! mcClassName . equals ( "" ) ) ; classes . add ( mcClassName ) ; if ( mcClassName != null && ! mcClassName . equals ( "" ) ) mcfdef . setMcClass ( mcClassName ) ; System . out . print ( rb . getString ( "mcf.use.cci" ) + " " + rb . getString ( "yesno" ) + " [N]: " ) ; String useCciConnection = in . readLine ( ) ; if ( useCciConnection == null ) mcfdef . setUseCciConnection ( false ) ; else { if ( useCciConnection . equals ( "Y" ) || useCciConnection . equals ( "y" ) || useCciConnection . equals ( "Yes" ) ) mcfdef . setUseCciConnection ( true ) ; else mcfdef . setUseCciConnection ( false ) ; } if ( ! mcfdef . isUseCciConnection ( ) ) { String cfInterfaceName = "" ; do { System . out . print ( rb . getString ( "cf.interface.name" ) ) ; System . out . print ( " [" + mcfdef . getCfInterfaceClass ( ) + "]: " ) ; cfInterfaceName = in . readLine ( ) ; if ( ! cfInterfaceName . equals ( "" ) && ! Pattern . matches ( CLASS_NAME_PATTERN , cfInterfaceName ) ) { System . out . println ( rb . getString ( "class.name.validated" ) ) ; } } while ( ( classes . contains ( cfInterfaceName ) || ! Pattern . matches ( CLASS_NAME_PATTERN , cfInterfaceName ) ) && ! cfInterfaceName . equals ( "" ) ) ; classes . add ( cfInterfaceName ) ; if ( cfInterfaceName != null && ! cfInterfaceName . equals ( "" ) ) mcfdef . setCfInterfaceClass ( cfInterfaceName ) ; String cfClassName = "" ; do { System . out . print ( rb . getString ( "cf.class.name" ) ) ; System . out . print ( " [" + mcfdef . getCfClass ( ) + "]: " ) ; cfClassName = in . readLine ( ) ; if ( ! cfClassName . equals ( "" ) && ! Pattern . matches ( CLASS_NAME_PATTERN , cfClassName ) ) { System . out . println ( rb . getString ( "class.name.validated" ) ) ; } } while ( ( classes . contains ( cfClassName ) || ! Pattern . matches ( CLASS_NAME_PATTERN , cfClassName ) ) && ! cfClassName . equals ( "" ) ) ; classes . add ( cfClassName ) ; if ( cfClassName != null && ! cfClassName . equals ( "" ) ) mcfdef . setCfClass ( cfClassName ) ; String connInterfaceName = "" ; do { System . out . print ( rb . getString ( "conn.interface.name" ) ) ; System . out . print ( " [" + mcfdef . getConnInterfaceClass ( ) + "]: " ) ; connInterfaceName = in . readLine ( ) ; if ( ! connInterfaceName . equals ( "" ) && ! Pattern . matches ( CLASS_NAME_PATTERN , connInterfaceName ) ) { System . out . println ( rb . getString ( "class.name.validated" ) ) ; } } while ( ( classes . contains ( connInterfaceName ) || ! Pattern . matches ( CLASS_NAME_PATTERN , connInterfaceName ) ) && ! connInterfaceName . equals ( "" ) ) ; classes . add ( connInterfaceName ) ; if ( connInterfaceName != null && ! connInterfaceName . equals ( "" ) ) mcfdef . setConnInterfaceClass ( connInterfaceName ) ; String connImplName = "" ; do { System . out . print ( rb . getString ( "conn.class.name" ) ) ; System . out . print ( " [" + mcfdef . getConnImplClass ( ) + "]: " ) ; connImplName = in . readLine ( ) ; if ( ! connImplName . equals ( "" ) && ! Pattern . matches ( CLASS_NAME_PATTERN , connImplName ) ) { System . out . println ( rb . getString ( "class.name.validated" ) ) ; } } while ( ( classes . contains ( connImplName ) || ! Pattern . matches ( CLASS_NAME_PATTERN , connImplName ) ) && ! connImplName . equals ( "" ) ) ; classes . add ( connImplName ) ; if ( connImplName != null && ! connImplName . equals ( "" ) ) mcfdef . setConnImplClass ( connImplName ) ; System . out . print ( rb . getString ( "connection.method.support" ) + " " + rb . getString ( "yesno" ) + " [N]: " ) ; String supportMethod = in . readLine ( ) ; if ( supportMethod == null ) mcfdef . setDefineMethodInConnection ( false ) ; else { if ( supportMethod . equals ( "Y" ) || supportMethod . equals ( "y" ) || supportMethod . equals ( "Yes" ) ) mcfdef . setDefineMethodInConnection ( true ) ; else mcfdef . setDefineMethodInConnection ( false ) ; } if ( mcfdef . isDefineMethodInConnection ( ) ) { mcfdef . setMethods ( inputMethod ( in ) ) ; } } mcfDefs . add ( mcfdef ) ; mcfID ++ ; moreMcf = false ; if ( def . getVersion ( ) . equals ( "1.5" ) || def . getVersion ( ) . equals ( "1.6" ) || def . getVersion ( ) . equals ( "1.7" ) ) { System . out . print ( rb . getString ( "more.mcf" ) + " " + rb . getString ( "yesno" ) + " [N]: " ) ; String inputMoreMcf = in . readLine ( ) ; if ( inputMoreMcf != null && ( inputMoreMcf . equals ( "Y" ) || inputMoreMcf . equals ( "y" ) || inputMoreMcf . equals ( "Yes" ) ) ) moreMcf = true ; } } while ( moreMcf ) ; } // inbound
if ( def . isSupportInbound ( ) ) { String mlClassName = "" ; do { System . out . print ( rb . getString ( "ml.interface.name" ) ) ; System . out . print ( " [" + def . getMlClass ( ) + "]: " ) ; mlClassName = in . readLine ( ) ; if ( ! mlClassName . equals ( "" ) && ! Pattern . matches ( CLASS_NAME_PATTERN , mlClassName ) ) { System . out . println ( rb . getString ( "class.name.validated" ) ) ; } } while ( ( classes . contains ( mlClassName ) || ! Pattern . matches ( CLASS_NAME_PATTERN , mlClassName ) ) && ! mlClassName . equals ( "" ) ) ; classes . add ( mlClassName ) ; boolean defaultPackage = true ; if ( mlClassName != null && ! mlClassName . equals ( "" ) ) { def . setMlClass ( mlClassName ) ; if ( mlClassName . contains ( "." ) ) defaultPackage = false ; else { setDefaultValue ( def , mlClassName , "MessageListener" ) ; setDefaultValue ( def , mlClassName , "Ml" ) ; } } def . setDefaultPackageInbound ( defaultPackage ) ; String asClassName = "" ; do { System . out . print ( rb . getString ( "as.class.name" ) ) ; System . out . print ( " [" + def . getAsClass ( ) + "]: " ) ; asClassName = in . readLine ( ) ; if ( ! asClassName . equals ( "" ) && ! Pattern . matches ( CLASS_NAME_PATTERN , asClassName ) ) { System . out . println ( rb . getString ( "class.name.validated" ) ) ; } } while ( ( classes . contains ( asClassName ) || ! Pattern . matches ( CLASS_NAME_PATTERN , asClassName ) ) && ! asClassName . equals ( "" ) ) ; classes . add ( asClassName ) ; if ( asClassName != null && ! asClassName . equals ( "" ) ) def . setAsClass ( asClassName ) ; List < ConfigPropType > asProps = inputProperties ( "as" , in , true ) ; def . setAsConfigProps ( asProps ) ; String actiClassName = "" ; do { System . out . print ( rb . getString ( "acti.class.name" ) ) ; System . out . print ( " [" + def . getActivationClass ( ) + "]: " ) ; actiClassName = in . readLine ( ) ; if ( ! actiClassName . equals ( "" ) && ! Pattern . matches ( CLASS_NAME_PATTERN , actiClassName ) ) { System . out . println ( rb . getString ( "class.name.validated" ) ) ; } } while ( ( classes . contains ( actiClassName ) || ! Pattern . matches ( CLASS_NAME_PATTERN , actiClassName ) ) && ! actiClassName . equals ( "" ) ) ; classes . add ( actiClassName ) ; if ( actiClassName != null && ! actiClassName . equals ( "" ) ) def . setActivationClass ( actiClassName ) ; } // admin object
System . out . print ( rb . getString ( "gen.adminobject" ) + " " + rb . getString ( "yesno" ) + " [N]: " ) ; String genAo = in . readLine ( ) ; if ( genAo == null ) def . setGenAdminObject ( false ) ; else { if ( genAo . equals ( "Y" ) || genAo . equals ( "y" ) || genAo . equals ( "Yes" ) ) def . setGenAdminObject ( true ) ; else def . setGenAdminObject ( false ) ; } if ( def . isGenAdminObject ( ) ) { System . out . print ( rb . getString ( "adminobject.raa" ) + " " + rb . getString ( "yesno" ) + " [Y]: " ) ; String aoRaAssociation = in . readLine ( ) ; if ( aoRaAssociation == null || aoRaAssociation . equals ( "" ) ) def . setAdminObjectImplRaAssociation ( true ) ; else { if ( aoRaAssociation . equals ( "Y" ) || aoRaAssociation . equals ( "y" ) || aoRaAssociation . equals ( "Yes" ) ) def . setAdminObjectImplRaAssociation ( true ) ; else def . setAdminObjectImplRaAssociation ( false ) ; } } int numOfAo = 0 ; while ( numOfAo >= 0 && def . isGenAdminObject ( ) ) { String strOrder = numOfAo > 0 ? Integer . valueOf ( numOfAo ) . toString ( ) : "" ; AdminObjectType aoType = new AdminObjectType ( ) ; String aoInterfaceName = "" ; do { System . out . print ( rb . getString ( "adminobject.interface.name" ) ) ; System . out . print ( " [" + def . getDefaultValue ( ) + strOrder + "AdminObject]: " ) ; aoInterfaceName = in . readLine ( ) ; if ( ! aoInterfaceName . equals ( "" ) && ! Pattern . matches ( CLASS_NAME_PATTERN , aoInterfaceName ) ) { System . out . println ( rb . getString ( "class.name.validated" ) ) ; } } while ( ( classes . contains ( aoInterfaceName ) || ! Pattern . matches ( CLASS_NAME_PATTERN , aoInterfaceName ) ) && ! aoInterfaceName . equals ( "" ) ) ; classes . add ( aoInterfaceName ) ; if ( aoInterfaceName != null && ! aoInterfaceName . equals ( "" ) ) { aoType . setAdminObjectInterface ( aoInterfaceName ) ; } else { aoType . setAdminObjectInterface ( def . getDefaultValue ( ) + strOrder + "AdminObject" ) ; } String aoClassName = "" ; do { System . out . print ( rb . getString ( "adminobject.class.name" ) ) ; System . out . print ( " [" + def . getDefaultValue ( ) + strOrder + "AdminObjectImpl]: " ) ; aoClassName = in . readLine ( ) ; if ( ! aoClassName . equals ( "" ) && ! Pattern . matches ( CLASS_NAME_PATTERN , aoClassName ) ) { System . out . println ( rb . getString ( "class.name.validated" ) ) ; } } while ( ( classes . contains ( aoClassName ) || ! Pattern . matches ( CLASS_NAME_PATTERN , aoClassName ) ) && ! aoClassName . equals ( "" ) ) ; classes . add ( aoClassName ) ; if ( aoClassName != null && ! aoClassName . equals ( "" ) ) { aoType . setAdminObjectClass ( aoClassName ) ; } else { aoType . setAdminObjectClass ( def . getDefaultValue ( ) + strOrder + "AdminObjectImpl" ) ; } List < ConfigPropType > aoProps = inputProperties ( "adminobject" , in , false ) ; aoType . setAoConfigProps ( aoProps ) ; if ( def . getAdminObjects ( ) == null ) def . setAdminObjects ( new ArrayList < AdminObjectType > ( ) ) ; def . getAdminObjects ( ) . add ( aoType ) ; System . out . print ( rb . getString ( "gen.adminobject.other" ) + " " + rb . getString ( "yesno" ) + " [N]: " ) ; String genAoAgain = in . readLine ( ) ; if ( genAoAgain == null ) numOfAo = - 1 ; else { if ( genAoAgain . equals ( "Y" ) || genAoAgain . equals ( "y" ) || genAoAgain . equals ( "Yes" ) ) numOfAo ++ ; else numOfAo = - 1 ; } } if ( ! def . getVersion ( ) . equals ( "1.0" ) && def . isSupportOutbound ( ) && ! def . getMcfDefs ( ) . get ( 0 ) . isUseCciConnection ( ) ) { // generate mbean classes
System . out . print ( rb . getString ( "gen.mbean" ) + " " + rb . getString ( "yesno" ) + " [Y]: " ) ; String genMbean = in . readLine ( ) ; if ( genMbean == null ) def . setGenMbean ( true ) ; else { if ( genMbean . equals ( "N" ) || genMbean . equals ( "n" ) || genMbean . equals ( "No" ) ) def . setGenMbean ( false ) ; else def . setGenMbean ( true ) ; } // generate eis test server support
System . out . print ( rb . getString ( "gen.eis" ) + " " + rb . getString ( "yesno" ) + " [N]: " ) ; String genEis = in . readLine ( ) ; if ( genEis == null ) def . setSupportEis ( false ) ; else { if ( genEis . equals ( "Y" ) || genEis . equals ( "y" ) || genEis . equals ( "Yes" ) ) def . setSupportEis ( true ) ; else def . setSupportEis ( false ) ; } if ( def . isSupportEis ( ) ) { // add default host and post for eis server
if ( def . getMcfDefs ( ) . get ( 0 ) . getMcfConfigProps ( ) == null ) { def . getMcfDefs ( ) . get ( 0 ) . setMcfConfigProps ( new ArrayList < ConfigPropType > ( ) ) ; } List < ConfigPropType > props = def . getMcfDefs ( ) . get ( 0 ) . getMcfConfigProps ( ) ; ConfigPropType host = new ConfigPropType ( "host" , "String" , "localhost" , false ) ; props . add ( host ) ; ConfigPropType port = new ConfigPropType ( "port" , "Integer" , "1400" , false ) ; props . add ( port ) ; } } // generate logging support
System . out . print ( rb . getString ( "support.jbosslogging" ) + " " + rb . getString ( "yesno" ) + " [N]: " ) ; String supportJbossLogging = in . readLine ( ) ; if ( supportJbossLogging == null ) def . setSupportJbossLogging ( false ) ; else { if ( supportJbossLogging . equals ( "Y" ) || supportJbossLogging . equals ( "y" ) || supportJbossLogging . equals ( "Yes" ) ) def . setSupportJbossLogging ( true ) ; else def . setSupportJbossLogging ( false ) ; } // build environment
System . out . print ( rb . getString ( "build.env" ) + " " + rb . getString ( "build.env.values" ) ) ; System . out . print ( " [" + def . getBuild ( ) + "]: " ) ; String buildEnv = in . readLine ( ) ; if ( buildEnv != null && ! buildEnv . equals ( "" ) ) { if ( buildEnv . equalsIgnoreCase ( "i" ) || buildEnv . equalsIgnoreCase ( "ant+ivy" ) || buildEnv . equalsIgnoreCase ( "ivy" ) ) { def . setBuild ( "ivy" ) ; } else if ( buildEnv . equalsIgnoreCase ( "m" ) || buildEnv . equalsIgnoreCase ( "maven" ) ) { def . setBuild ( "maven" ) ; } else if ( buildEnv . equalsIgnoreCase ( "g" ) || buildEnv . equalsIgnoreCase ( "gradle" ) ) { def . setBuild ( "gradle" ) ; } else def . setBuild ( "ant" ) ; } else def . setBuild ( "ant" ) ; return def ;
|
public class DisableDirectoryRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DisableDirectoryRequest disableDirectoryRequest , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( disableDirectoryRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( disableDirectoryRequest . getDirectoryArn ( ) , DIRECTORYARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class ExceptionUtils { /** * < p > stackTrace . < / p >
* @ param t a { @ link java . lang . Throwable } object .
* @ param separator a { @ link java . lang . String } object .
* @ param depth a int .
* @ return a { @ link java . lang . String } object . */
public static String stackTrace ( Throwable t , String separator , int depth ) { } }
|
if ( GreenPepper . isDebugEnabled ( ) ) depth = FULL ; StringWriter sw = new StringWriter ( ) ; sw . append ( t . toString ( ) ) ; for ( int i = 0 ; i < t . getStackTrace ( ) . length && i <= depth ; i ++ ) { StackTraceElement element = t . getStackTrace ( ) [ i ] ; sw . append ( separator ) . append ( element . toString ( ) ) ; } return sw . toString ( ) ;
|
public class GeometricDoubleBondEncoderFactory { /** * Create a stereo encoder for all potential 2D and 3D double bond stereo
* configurations .
* @ param container an atom container
* @ param graph adjacency list representation of the container
* @ return a new encoder for tetrahedral elements */
@ Override public StereoEncoder create ( IAtomContainer container , int [ ] [ ] graph ) { } }
|
List < StereoEncoder > encoders = new ArrayList < StereoEncoder > ( 5 ) ; for ( IBond bond : container . bonds ( ) ) { // if double bond and not E or Z query bond
if ( DOUBLE . equals ( bond . getOrder ( ) ) && ! E_OR_Z . equals ( bond . getStereo ( ) ) ) { IAtom left = bond . getBegin ( ) ; IAtom right = bond . getEnd ( ) ; // skip - N = N - double bonds which exhibit inversion
if ( Integer . valueOf ( 7 ) . equals ( left . getAtomicNumber ( ) ) && Integer . valueOf ( 7 ) . equals ( right . getAtomicNumber ( ) ) ) continue ; StereoEncoder encoder = newEncoder ( container , left , right , right , left , graph ) ; if ( encoder != null ) { encoders . add ( encoder ) ; } } } return encoders . isEmpty ( ) ? StereoEncoder . EMPTY : new MultiStereoEncoder ( encoders ) ;
|
public class CmsEditableGroup { /** * Sets the error message . < p >
* @ param errorMessage the error message */
public void setErrorMessage ( String errorMessage ) { } }
|
m_errorMessage = errorMessage ; m_errorLabel . setValue ( errorMessage != null ? errorMessage : "" ) ;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.