signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ExceptionFactory { /** * Creates an exception from an plan id and version . * @ param planId the plan id * @ param version the version id * @ return the exception */ public static final PlanVersionNotFoundException planVersionNotFoundException ( String planId , String version ) { } }
return new PlanVersionNotFoundException ( Messages . i18n . format ( "PlanVersionDoesNotExist" , planId , version ) ) ; // $ NON - NLS - 1 $
public class TransformerFactoryImpl { /** * < p > Set a feature for this < code > TransformerFactory < / code > and < code > Transformer < / code > s * or < code > Template < / code > s created by this factory . < / p > * Feature names are fully qualified { @ link java . net . URI } s . * Implementations may define their own features . * An { @ link TransformerConfigurationException } is thrown if this < code > TransformerFactory < / code > or the * < code > Transformer < / code > s or < code > Template < / code > s it creates cannot support the feature . * It is possible for an < code > TransformerFactory < / code > to expose a feature value but be unable to change its state . * < p > See { @ link javax . xml . transform . TransformerFactory } for full documentation of specific features . < / p > * @ param name Feature name . * @ param value Is feature state < code > true < / code > or < code > false < / code > . * @ throws TransformerConfigurationException if this < code > TransformerFactory < / code > * or the < code > Transformer < / code > s or < code > Template < / code > s it creates cannot support this feature . * @ throws NullPointerException If the < code > name < / code > parameter is null . */ public void setFeature ( String name , boolean value ) throws TransformerConfigurationException { } }
// feature name cannot be null if ( name == null ) { throw new NullPointerException ( XSLMessages . createMessage ( XSLTErrorResources . ER_SET_FEATURE_NULL_NAME , null ) ) ; } // secure processing ? if ( name . equals ( XMLConstants . FEATURE_SECURE_PROCESSING ) ) { m_isSecureProcessing = value ; } // This implementation does not support the setting of a feature other than // the secure processing feature . else { throw new TransformerConfigurationException ( XSLMessages . createMessage ( XSLTErrorResources . ER_UNSUPPORTED_FEATURE , new Object [ ] { name } ) ) ; }
public class RaXmlGen { /** * Output xml * @ param def definition * @ param out Writer * @ throws IOException ioException */ @ Override public void writeXmlBody ( Definition def , Writer out ) throws IOException { } }
writeConnectorVersion ( out ) ; int indent = 1 ; writeIndent ( out , indent ) ; out . write ( "<vendor-name>Red Hat Inc</vendor-name>" ) ; writeEol ( out ) ; writeIndent ( out , indent ) ; out . write ( "<eis-type>Test RA</eis-type>" ) ; writeEol ( out ) ; writeIndent ( out , indent ) ; out . write ( "<resourceadapter-version>0.1</resourceadapter-version>" ) ; writeEol ( out ) ; writeIndent ( out , indent ) ; out . write ( "<resourceadapter>" ) ; writeEol ( out ) ; if ( def . isUseRa ( ) ) { writeIndent ( out , indent + 1 ) ; out . write ( "<resourceadapter-class>" + def . getRaPackage ( ) + "." + def . getRaClass ( ) + "</resourceadapter-class>" ) ; writeEol ( out ) ; writeConfigPropsXml ( def . getRaConfigProps ( ) , out , indent + 1 ) ; } if ( def . isSupportOutbound ( ) ) { writeOutbound ( def , out , indent + 1 ) ; } if ( def . isSupportInbound ( ) ) { writeInbound ( def , out , indent + 1 ) ; } if ( def . isGenAdminObject ( ) && def . getAdminObjects ( ) . size ( ) > 0 ) { for ( int i = 0 ; i < def . getAdminObjects ( ) . size ( ) ; i ++ ) { writeIndent ( out , indent + 1 ) ; out . write ( "<adminobject>" ) ; writeEol ( out ) ; writeIndent ( out , indent + 2 ) ; out . write ( "<adminobject-interface>" + def . getRaPackage ( ) + "." + def . getAdminObjects ( ) . get ( i ) . getAdminObjectInterface ( ) + "</adminobject-interface>" ) ; writeEol ( out ) ; writeIndent ( out , indent + 2 ) ; out . write ( "<adminobject-class>" + def . getRaPackage ( ) + "." + def . getAdminObjects ( ) . get ( i ) . getAdminObjectClass ( ) + "</adminobject-class>" ) ; writeEol ( out ) ; writeConfigPropsXml ( def . getAdminObjects ( ) . get ( i ) . getAoConfigProps ( ) , out , indent + 2 ) ; writeIndent ( out , indent + 1 ) ; out . write ( "</adminobject>" ) ; writeEol ( out ) ; } } if ( def . getSecurityPermissions ( ) != null && def . getSecurityPermissions ( ) . size ( ) > 0 ) { for ( int i = 0 ; i < def . getSecurityPermissions ( ) . size ( ) ; i ++ ) { writeIndent ( out , indent + 1 ) ; out . write ( "<security-permission>" ) ; writeEol ( out ) ; writeIndent ( out , indent + 2 ) ; out . write ( "<security-permission-spec>" + def . getSecurityPermissions ( ) . get ( i ) . getPermissionSpec ( ) + "</security-permission-spec>" ) ; writeEol ( out ) ; writeIndent ( out , indent + 1 ) ; out . write ( "</security-permission>" ) ; writeEol ( out ) ; } } writeIndent ( out , indent ) ; out . write ( "</resourceadapter>" ) ; writeEol ( out ) ; out . write ( "</connector>" ) ; writeEol ( out ) ;
public class InputFactory { /** * Returns an ArticleReader which reads the specified input file . * @ param archive * input file * @ return ArticleReaderInterface * @ throws ConfigurationException * if an error occurred while accessing the configuration * @ throws ArticleReaderException * if an error occurred while parsing the file */ public static ArticleReaderInterface getTaskReader ( final ArchiveDescription archive ) throws ConfigurationException , ArticleReaderException { } }
Reader reader = null ; switch ( archive . getType ( ) ) { case XML : reader = readXMLFile ( archive . getPath ( ) ) ; break ; case SEVENZIP : reader = decompressWith7Zip ( archive . getPath ( ) ) ; break ; case BZIP2 : reader = decompressWithBZip2 ( archive . getPath ( ) ) ; break ; default : throw ErrorFactory . createArticleReaderException ( ErrorKeys . DELTA_CONSUMERS_TASK_READER_INPUTFACTORY_ILLEGAL_INPUTMODE_VALUE ) ; } if ( MODE_STATISTICAL_OUTPUT ) { return new TimedWikipediaXMLReader ( reader ) ; } return new WikipediaXMLReader ( reader ) ;
public class ListUtil { /** * finds a value inside a list , case sensitive , ignore empty items * @ param list list to search * @ param value value to find * @ param delimiter delimiter of the list * @ return position in list or 0 */ public static int listFindIgnoreEmpty ( String list , String value , char delimiter ) { } }
if ( list == null ) return - 1 ; int len = list . length ( ) ; if ( len == 0 ) return - 1 ; int last = 0 ; int count = 0 ; for ( int i = 0 ; i < len ; i ++ ) { if ( list . charAt ( i ) == delimiter ) { if ( last < i ) { if ( list . substring ( last , i ) . equals ( value ) ) return count ; count ++ ; } last = i + 1 ; } } if ( last < len ) { if ( list . substring ( last ) . equals ( value ) ) return count ; } return - 1 ;
public class EsUtil { /** * create a new index and return its name . No alias will point to * the new index . * @ param name basis for new name * @ param mappingPath path to mapping file . * @ return name of created index . * @ throws IndexException for errors */ public String newIndex ( final String name , final String mappingPath ) throws IndexException { } }
try { final String newName = name + newIndexSuffix ( ) ; final IndicesAdminClient idx = getAdminIdx ( ) ; final CreateIndexRequestBuilder cirb = idx . prepareCreate ( newName ) ; final File f = new File ( mappingPath ) ; final byte [ ] sbBytes = Streams . copyToByteArray ( f ) ; cirb . setSource ( sbBytes ) ; final CreateIndexRequest cir = cirb . request ( ) ; final ActionFuture < CreateIndexResponse > af = idx . create ( cir ) ; /* resp = */ af . actionGet ( ) ; // index ( new UpdateInfo ( ) ) ; info ( "Index created" ) ; return newName ; } catch ( final ElasticsearchException ese ) { // Failed somehow error ( ese ) ; return null ; } catch ( final IndexException ie ) { throw ie ; } catch ( final Throwable t ) { error ( t ) ; throw new IndexException ( t ) ; }
public class Version { /** * Increments the patch version and appends the pre - release version . * @ param preRelease the pre - release version to append * @ return a new instance of the { @ code Version } class * @ throws IllegalArgumentException if the input string is { @ code NULL } or empty * @ throws ParseException when invalid version string is provided * @ throws UnexpectedCharacterException is a special case of { @ code ParseException } */ public Version incrementPatchVersion ( String preRelease ) { } }
return new Version ( normal . incrementPatch ( ) , VersionParser . parsePreRelease ( preRelease ) ) ;
public class MediaBatchOperations { /** * Parses the parts core . * @ param entityInputStream * the entity input stream * @ param contentType * the content type * @ return the list * @ throws MessagingException * the messaging exception * @ throws IOException * Signals that an I / O exception has occurred . */ private List < DataSource > parsePartsCore ( InputStream entityInputStream , String contentType ) throws MessagingException , IOException { } }
DataSource dataSource = new InputStreamDataSource ( entityInputStream , contentType ) ; MimeMultipart batch = new MimeMultipart ( dataSource ) ; MimeBodyPart batchBody = ( MimeBodyPart ) batch . getBodyPart ( 0 ) ; MimeMultipart changeSets = new MimeMultipart ( new MimePartDataSource ( batchBody ) ) ; List < DataSource > result = new ArrayList < DataSource > ( ) ; for ( int i = 0 ; i < changeSets . getCount ( ) ; i ++ ) { BodyPart part = changeSets . getBodyPart ( i ) ; result . add ( new InputStreamDataSource ( part . getInputStream ( ) , part . getContentType ( ) ) ) ; } return result ;
public class Comparators { /** * Returns a comparator which can sort single or multi - dimensional arrays * of primitves or Comparables . * @ param unsigned applicable only to arrays of bytes , shorts , ints , or longs * @ return null if unsupported */ public static < T > Comparator < T > arrayComparator ( Class < T > arrayType , boolean unsigned ) { } }
if ( ! arrayType . isArray ( ) ) { throw new IllegalArgumentException ( ) ; } Comparator c ; TypeDesc componentType = TypeDesc . forClass ( arrayType . getComponentType ( ) ) ; switch ( componentType . getTypeCode ( ) ) { case TypeDesc . BYTE_CODE : c = unsigned ? UnsignedByteArray : SignedByteArray ; break ; case TypeDesc . SHORT_CODE : c = unsigned ? UnsignedShortArray : SignedShortArray ; break ; case TypeDesc . INT_CODE : c = unsigned ? UnsignedIntArray : SignedIntArray ; break ; case TypeDesc . LONG_CODE : c = unsigned ? UnsignedLongArray : SignedLongArray ; break ; case TypeDesc . BOOLEAN_CODE : c = BooleanArray ; break ; case TypeDesc . CHAR_CODE : c = CharArray ; break ; case TypeDesc . FLOAT_CODE : c = FloatArray ; break ; case TypeDesc . DOUBLE_CODE : c = DoubleArray ; break ; case TypeDesc . OBJECT_CODE : default : if ( componentType . isArray ( ) ) { c = new ComparatorArray ( arrayComparator ( componentType . toClass ( ) , unsigned ) ) ; } else if ( Comparable . class . isAssignableFrom ( componentType . toClass ( ) ) ) { c = ComparableArray ; } else { c = null ; } break ; } return ( Comparator < T > ) c ;
public class ARouter { /** * Launch the navigation by type * @ param service interface of service * @ param < T > return type * @ return instance of service */ public < T > T navigation ( Class < ? extends T > service ) { } }
return _ARouter . getInstance ( ) . navigation ( service ) ;
public class UpdateBuilder { /** * Adds a new mutation to the batch . */ private Mutation addMutation ( ) { } }
Preconditions . checkState ( ! committed , "Cannot modify a WriteBatch that has already been committed." ) ; Mutation mutation = new Mutation ( ) ; mutations . add ( mutation ) ; return mutation ;
public class Rectangle { /** * Enlarges the Rectangle sides individually * @ param left left enlargement * @ param top top enlargement * @ param right right enlargement * @ param bottom bottom enlargement * @ return */ public Rectangle enlarge ( double left , double top , double right , double bottom ) { } }
return new Rectangle ( this . left - left , this . top - top , this . right + right , this . bottom + bottom ) ;
public class BaseMessageRecordDesc { /** * Move the correct fields from this current record to the map . * If this method is used , is must be overidden to move the correct fields . * @ param record The record to get the data from . */ public int putRawRecordData ( Rec record ) { } }
if ( this . getNodeType ( ) == BaseMessageRecordDesc . NON_UNIQUE_NODE ) this . getMessage ( ) . createNewNode ( this . getFullKey ( null ) ) ; return super . putRawRecordData ( record ) ;
public class BeanContextServicesSupport { /** * This method is called everytime a child is removed from this context . * The implementation releases all services requested by the child . * @ see com . googlecode . openbeans . beancontext . BeanContextSupport # childJustRemovedHook ( java . lang . Object , * com . googlecode . openbeans . beancontext . BeanContextSupport . BCSChild ) */ protected void childJustRemovedHook ( Object child , BCSChild bcsChild ) { } }
if ( bcsChild instanceof BCSSChild ) { releaseServicesForChild ( ( BCSSChild ) bcsChild , false ) ; }
public class Discrete { /** * Formats a vector of Pair into a string in the form * ` ( x _ 1 , y _ 1 ) . . . ( x _ n , y _ n ) ` * @ param xy is the vector of Pair * @ param prefix indicates the prefix of a Pair , e . g . , ` ( ` results in * ` ( x _ i ` * @ param innerSeparator indicates the separator between * ` x ` and ` y ` , e . g . , ` , ` results in ` x _ i , y _ i ` * @ param suffix indicates the postfix of a Pair , e . g . , ` ] ` results in * ` y _ i ] ` * @ param outerSeparator indicates the separator between Pair , e . g . , ` ; ` * results in ` ( x _ i , y _ i ) ; ( x _ j , y _ j ) ` * @ return a formatted string containing the pairs of ` ( x , y ) ` values */ public static String formatXY ( List < Discrete . Pair > xy , String prefix , String innerSeparator , String suffix , String outerSeparator ) { } }
StringBuilder result = new StringBuilder ( ) ; Iterator < Pair > it = xy . iterator ( ) ; while ( it . hasNext ( ) ) { Pair pair = it . next ( ) ; result . append ( prefix ) . append ( Op . str ( pair . getX ( ) ) ) . append ( innerSeparator ) . append ( Op . str ( pair . getY ( ) ) ) . append ( suffix ) ; if ( it . hasNext ( ) ) { result . append ( outerSeparator ) ; } } return result . toString ( ) ;
public class CartItemUrl { /** * Get Resource Url for GetCartItem * @ param cartItemId Identifier of the cart item to delete . * @ param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object . This parameter should only be used to retrieve data . Attempting to update data using this parameter may cause data loss . * @ return String Resource Url */ public static MozuUrl getCartItemUrl ( String cartItemId , String responseFields ) { } }
UrlFormatter formatter = new UrlFormatter ( "/api/commerce/carts/current/items/{cartItemId}?responseFields={responseFields}" ) ; formatter . formatUrl ( "cartItemId" , cartItemId ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ;
public class SavedSettingsFile { /** * Remove a given key from the file . * @ param key Key to remove */ public void remove ( String key ) { } }
Iterator < Pair < String , ArrayList < String > > > it = store . iterator ( ) ; while ( it . hasNext ( ) ) { String thisKey = it . next ( ) . first ; if ( key . equals ( thisKey ) ) { it . remove ( ) ; break ; } }
public class WaitBuilder { /** * The HTTP condition to wait for during execution . * @ deprecated in favor of { @ link # http ( ) } */ @ Deprecated public WaitHttpConditionBuilder http ( String url ) { } }
HttpCondition condition = new HttpCondition ( ) ; condition . setUrl ( url ) ; container . setCondition ( condition ) ; this . buildAndRun ( ) ; return new WaitHttpConditionBuilder ( condition , this ) ;
public class SipCall { /** * This method is the same as the basic respondToDisconnect ( ) method except that it uses the given * parameters for the status code and reason in the response message sent out and allows the * caller to specify a message body and / or additional JAIN - SIP API message headers to add to or * replace in the outbound message . Use of this method requires knowledge of the JAIN - SIP API . * The extra parameters supported by this method are : * @ param statusCode The integer status code to use ( ie , SipResponse . OK ) . * @ param reasonPhrase The String reason phrase to use . * @ param additionalHeaders ArrayList of javax . sip . header . Header , each element a SIP header to add * to the outbound message . These headers are added to the message after a correct message * has been constructed . Note that if you try to add a header that there is only supposed * to be one of in a message , and it ' s already there and only one single value is allowed * for that header , then this header addition attempt will be ignored . Use the * ' replaceHeaders ' parameter instead if you want to replace the existing header with your * own . Use null for no additional message headers . * @ param replaceHeaders ArrayList of javax . sip . header . Header , each element a SIP header to add to * the outbound message , replacing existing header ( s ) of that type if present in the * message . These headers are applied to the message after a correct message has been * constructed . Use null for no replacement of message headers . * @ param body A String to be used as the body of the message . The additionalHeaders parameter * must contain a ContentTypeHeader for this body to be included in the message . Use null * for no body bytes . */ public boolean respondToDisconnect ( int statusCode , String reasonPhrase , ArrayList < Header > additionalHeaders , ArrayList < Header > replaceHeaders , String body ) { } }
initErrorInfo ( ) ; if ( parent . sendReply ( transaction , statusCode , reasonPhrase , myTag , null , - 1 , additionalHeaders , replaceHeaders , body ) != null ) { return true ; } setReturnCode ( parent . getReturnCode ( ) ) ; setException ( parent . getException ( ) ) ; setErrorMessage ( "respondToDisconnect(JSIP headers/body) - " + parent . getErrorMessage ( ) ) ; return false ;
public class ELJavascriptBundleTagBeanInfo { /** * ( non - Javadoc ) * @ see java . beans . SimpleBeanInfo # getPropertyDescriptors ( ) */ @ Override public PropertyDescriptor [ ] getPropertyDescriptors ( ) { } }
List < PropertyDescriptor > proplist = new ArrayList < > ( ) ; try { proplist . add ( new PropertyDescriptor ( "type" , ELJavascriptBundleTag . class , null , "setTypeExpr" ) ) ; } catch ( IntrospectionException ex ) { } try { proplist . add ( new PropertyDescriptor ( "async" , ELJavascriptBundleTag . class , null , "setAsync" ) ) ; } catch ( IntrospectionException ex ) { } try { proplist . add ( new PropertyDescriptor ( "defer" , ELJavascriptBundleTag . class , null , "setDefer" ) ) ; } catch ( IntrospectionException ex ) { } try { proplist . add ( new PropertyDescriptor ( "src" , ELJavascriptBundleTag . class , null , "setSrcExpr" ) ) ; } catch ( IntrospectionException ex ) { } try { proplist . add ( new PropertyDescriptor ( "useRandomParam" , ELJavascriptBundleTag . class , null , "setUseRandomParamExpr" ) ) ; } catch ( IntrospectionException ex ) { } PropertyDescriptor [ ] result = new PropertyDescriptor [ proplist . size ( ) ] ; return ( ( PropertyDescriptor [ ] ) proplist . toArray ( result ) ) ;
public class Bean { /** * Constructs the bean object with dependencies resolved . * @ return bean object * @ throws Exception exception */ private T instantiateReference ( ) throws Exception { } }
final T ret = proxyClass . newInstance ( ) ; ( ( ProxyObject ) ret ) . setHandler ( javassistMethodHandler ) ; LOGGER . log ( Level . TRACE , "Uses Javassist method handler for bean [class={0}]" , beanClass . getName ( ) ) ; return ret ;
public class TiledMap { /** * Retrieve the image source property for a given object * @ param groupID * Index of a group * @ param objectID * Index of an object * @ return The image source reference or null if one isn ' t defined */ public String getObjectImage ( int groupID , int objectID ) { } }
if ( groupID >= 0 && groupID < objectGroups . size ( ) ) { ObjectGroup grp = ( ObjectGroup ) objectGroups . get ( groupID ) ; if ( objectID >= 0 && objectID < grp . objects . size ( ) ) { GroupObject object = ( GroupObject ) grp . objects . get ( objectID ) ; if ( object == null ) { return null ; } return object . image ; } } return null ;
public class OntRelationMention { /** * getter for domainList - gets * @ generated * @ return value of the feature */ public FSArray getDomainList ( ) { } }
if ( OntRelationMention_Type . featOkTst && ( ( OntRelationMention_Type ) jcasType ) . casFeat_domainList == null ) jcasType . jcas . throwFeatMissing ( "domainList" , "de.julielab.jules.types.OntRelationMention" ) ; return ( FSArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( OntRelationMention_Type ) jcasType ) . casFeatCode_domainList ) ) ) ;
public class PhoenixReader { /** * Map from an activity code value UUID to the actual value itself , and its * sequence number . * @ param storepoint storepoint containing current project data */ private void processActivityCodes ( Storepoint storepoint ) { } }
for ( Code code : storepoint . getActivityCodes ( ) . getCode ( ) ) { int sequence = 0 ; for ( Value value : code . getValue ( ) ) { UUID uuid = getUUID ( value . getUuid ( ) , value . getName ( ) ) ; m_activityCodeValues . put ( uuid , value . getName ( ) ) ; m_activityCodeSequence . put ( uuid , Integer . valueOf ( ++ sequence ) ) ; } }
public class SRTServletResponse { /** * This method is used to prevent IllegalStateExceptions that may be thrown * because the engine attempts to report the error , but has no idea what state * the currently executing servlet has put this response into . The error reporting * will attempt to set the status code and will use getWriter ( ) which may not be * legal in the current response state . If we are attempting to report an error , * we don ' t care what the state is , so this method will force the response to * ignoreStateErrors . * @ param b The logical value to set the ignore state errors flag to . */ public void setIgnoreStateErrors ( boolean b ) { } }
// 311717 if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) // 306998.15 logger . logp ( Level . FINE , CLASS_NAME , "setIgnoreStateErrors" , " " + String . valueOf ( b ) , "[" + this + "]" ) ; _ignoreStateErrors = b ;
public class RunnerFactory { /** * Creates strict runner implementation */ public InternalRunner createStrict ( Class < ? > klass ) throws InvocationTargetException { } }
return create ( klass , new Supplier < MockitoTestListener > ( ) { public MockitoTestListener get ( ) { return new MismatchReportingTestListener ( Plugins . getMockitoLogger ( ) ) ; } } ) ;
public class CollectionUtils { /** * Like { @ link Collections # min ( java . util . Collection ) } except with a default value returned in the * case of an empty collection . */ public static < T extends Comparable < T > > T minOr ( Collection < T > values , T defaultVal ) { } }
if ( values . isEmpty ( ) ) { return defaultVal ; } else { return Collections . min ( values ) ; }
public class CharTrieIndex { /** * Creates the index tree using the accumulated documents * @ param maxLevels - Maximum depth of the tree to build * @ param minWeight - Minimum number of cursors for a node to be index using , exclusive bound * @ return this char trie index */ public CharTrieIndex index ( int maxLevels , int minWeight ) { } }
AtomicInteger numberSplit = new AtomicInteger ( 0 ) ; int depth = - 1 ; do { numberSplit . set ( 0 ) ; if ( 0 == ++ depth ) { numberSplit . incrementAndGet ( ) ; root ( ) . split ( ) ; } else { root ( ) . streamDecendents ( depth ) . forEach ( node -> { TrieNode godparent = node . godparent ( ) ; if ( node . getDepth ( ) < maxLevels ) { if ( null == godparent || godparent . getCursorCount ( ) > minWeight ) { if ( node . getChar ( ) != NodewalkerCodec . END_OF_STRING || node . getDepth ( ) == 0 ) { ( ( IndexNode ) node ) . split ( ) ; numberSplit . incrementAndGet ( ) ; } } } } ) ; } } while ( numberSplit . get ( ) > 0 ) ; return this ;
public class HttpUtil { /** * Performs an HTTP POST on the given URL . * Basic auth is used if both username and password are not null * @ param url The URL to connect to . * @ param file The file to send as MultiPartFile . * @ param username username * @ param password password * @ return The HTTP response as Response object . * @ throws URISyntaxException * @ throws HttpException */ public static Response post ( String url , File file , String username , String password ) throws URISyntaxException , HttpException { } }
return postMultiPart ( new HttpPost ( url ) , new FileBody ( file ) , new UsernamePasswordCredentials ( username , password ) , null ) ;
public class RecommendationsInner { /** * Get all recommendations for an app . * Get all recommendations for an app . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param siteName Name of the app . * @ param featured Specify & lt ; code & gt ; true & lt ; / code & gt ; to return only the most critical recommendations . The default is & lt ; code & gt ; false & lt ; / code & gt ; , which returns all recommendations . * @ param filter Return only channels specified in the filter . Filter is specified by using OData syntax . Example : $ filter = channels eq ' Api ' or channel eq ' Notification ' * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws DefaultErrorResponseException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the PagedList & lt ; RecommendationInner & gt ; object if successful . */ public PagedList < RecommendationInner > listRecommendedRulesForWebApp ( final String resourceGroupName , final String siteName , final Boolean featured , final String filter ) { } }
ServiceResponse < Page < RecommendationInner > > response = listRecommendedRulesForWebAppSinglePageAsync ( resourceGroupName , siteName , featured , filter ) . toBlocking ( ) . single ( ) ; return new PagedList < RecommendationInner > ( response . body ( ) ) { @ Override public Page < RecommendationInner > nextPage ( String nextPageLink ) { return listRecommendedRulesForWebAppNextSinglePageAsync ( nextPageLink ) . toBlocking ( ) . single ( ) . body ( ) ; } } ;
public class StorableIndexSet { /** * Return true if index is unique or fully contains the members of a unique index . */ private boolean isUniqueImplied ( StorableIndex < S > candidate ) { } }
if ( candidate . isUnique ( ) ) { return true ; } if ( this . size ( ) <= 1 ) { return false ; } Set < StorableProperty < S > > candidateProps = new HashSet < StorableProperty < S > > ( ) ; for ( int i = candidate . getPropertyCount ( ) ; -- i >= 0 ; ) { candidateProps . add ( candidate . getProperty ( i ) ) ; } search : for ( StorableIndex < S > index : this ) { if ( ! index . isUnique ( ) ) { continue search ; } for ( int i = index . getPropertyCount ( ) ; -- i >= 0 ; ) { if ( ! candidateProps . contains ( index . getProperty ( i ) ) ) { continue search ; } } return true ; } return false ;
public class AbstractSequencer { /** * Creates an event poller for this sequence that will use the supplied data provider and * gating sequences . * @ param dataProvider The data source for users of this event poller * @ param gatingSequences Sequence to be gated on . * @ return A poller that will gate on this ring buffer and the supplied sequences . */ @ Override public < T > EventPoller < T > newPoller ( DataProvider < T > dataProvider , Sequence ... gatingSequences ) { } }
return EventPoller . newInstance ( dataProvider , this , new Sequence ( ) , cursor , gatingSequences ) ;
public class Http2ClientStreamTransportState { /** * Inspect initial headers to make sure they conform to HTTP and gRPC , returning a { @ code Status } * on failure . * @ return status with description of failure , or { @ code null } when valid */ @ Nullable private Status validateInitialMetadata ( Metadata headers ) { } }
Integer httpStatus = headers . get ( HTTP2_STATUS ) ; if ( httpStatus == null ) { return Status . INTERNAL . withDescription ( "Missing HTTP status code" ) ; } String contentType = headers . get ( GrpcUtil . CONTENT_TYPE_KEY ) ; if ( ! GrpcUtil . isGrpcContentType ( contentType ) ) { return GrpcUtil . httpStatusToGrpcStatus ( httpStatus ) . augmentDescription ( "invalid content-type: " + contentType ) ; } return null ;
public class Line { /** * Configure the line * @ param start * The start point of the line * @ param end * The end point of the line */ public void set ( Vector2f start , Vector2f end ) { } }
super . pointsDirty = true ; if ( this . start == null ) { this . start = new Vector2f ( ) ; } this . start . set ( start ) ; if ( this . end == null ) { this . end = new Vector2f ( ) ; } this . end . set ( end ) ; vec = new Vector2f ( end ) ; vec . sub ( start ) ; lenSquared = vec . lengthSquared ( ) ;
public class FormulaParser { /** * Sets the internal lexer and the parser . * @ param lexer the lexer * @ param parser the parser */ void setLexerAndParser ( final Lexer lexer , final ParserWithFormula parser ) { } }
this . lexer = lexer ; this . parser = parser ; this . parser . setFormulaFactory ( this . f ) ; this . lexer . removeErrorListeners ( ) ; this . parser . removeErrorListeners ( ) ; this . parser . setErrorHandler ( new BailErrorStrategy ( ) ) ;
public class Strings { /** * removeWord . * @ param host * a { @ link java . lang . String } object . * @ param word * a { @ link java . lang . String } object . * @ return a { @ link java . lang . String } object . */ public static String removeWord ( final String host , final String word ) { } }
return removeWord ( host , word , DELIMITER ) ;
public class FSNamesystem { /** * Scan blocks in { @ link # neededReplications } and assign replication * work to data - nodes they belong to . * The number of process blocks equals either twice the number of live * data - nodes or the number of under - replicated blocks whichever is less . * @ return number of blocks scheduled for replication during this iteration . */ private int computeReplicationWork ( int blocksToProcess ) throws IOException { } }
// stall only useful for unit tests ( see TestFileAppend4 . java ) if ( stallReplicationWork ) { return 0 ; } // Choose the blocks to be replicated List < List < BlockInfo > > blocksToReplicate = chooseUnderReplicatedBlocks ( blocksToProcess ) ; // replicate blocks return computeReplicationWorkForBlocks ( blocksToReplicate ) ;
public class DynamoDBReflector { /** * Returns whether the method given is an annotated , no - args getter of a * version attribute . */ boolean isVersionAttributeGetter ( Method getter ) { } }
synchronized ( versionAttributeGetterCache ) { if ( ! versionAttributeGetterCache . containsKey ( getter ) ) { versionAttributeGetterCache . put ( getter , getter . getName ( ) . startsWith ( "get" ) && getter . getParameterTypes ( ) . length == 0 && ReflectionUtils . getterOrFieldHasAnnotation ( getter , DynamoDBVersionAttribute . class ) ) ; } return versionAttributeGetterCache . get ( getter ) ; }
public class Converter { /** * { @ inheritDoc } * @ return { @ code true } if the source value is an instance of our SOURCE bound and the target type is assignable * from our TARGET bound . If , the source value is an instance of the target type , returns ! * { @ link # isRejectNoop ( ) } . */ @ Override public boolean supports ( TherianContext context , Convert < ? extends SOURCE , ? super TARGET > convert ) { } }
return ! ( isNoop ( convert ) && isRejectNoop ( ) ) && TypeUtils . isAssignable ( convert . getSourceType ( ) . getType ( ) , getSourceBound ( ) ) && TypeUtils . isAssignable ( getTargetBound ( ) , convert . getTargetType ( ) . getType ( ) ) ;
public class AmazonConfigClient { /** * Returns the number of AWS Config rules that are compliant and noncompliant , up to a maximum of 25 for each . * @ param getComplianceSummaryByConfigRuleRequest * @ return Result of the GetComplianceSummaryByConfigRule operation returned by the service . * @ sample AmazonConfig . GetComplianceSummaryByConfigRule * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / config - 2014-11-12 / GetComplianceSummaryByConfigRule " * target = " _ top " > AWS API Documentation < / a > */ @ Override public GetComplianceSummaryByConfigRuleResult getComplianceSummaryByConfigRule ( GetComplianceSummaryByConfigRuleRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeGetComplianceSummaryByConfigRule ( request ) ;
public class FastThreadLocal { /** * Returns the current value for the current thread if it exists , { @ code null } otherwise . */ @ SuppressWarnings ( "unchecked" ) public final V getIfExists ( ) { } }
InternalThreadLocalMap threadLocalMap = InternalThreadLocalMap . getIfSet ( ) ; if ( threadLocalMap != null ) { Object v = threadLocalMap . indexedVariable ( index ) ; if ( v != InternalThreadLocalMap . UNSET ) { return ( V ) v ; } } return null ;
public class Descriptor { /** * Replace all the path param serializers registered with this descriptor with the the given path param serializers . * @ param pathParamSerializers The path param serializers to replace the existing ones with . * @ return A copy of this descriptor with the new path param serializers . */ public Descriptor replaceAllPathParamSerializers ( PMap < Type , PathParamSerializer < ? > > pathParamSerializers ) { } }
return new Descriptor ( name , calls , pathParamSerializers , messageSerializers , serializerFactory , exceptionSerializer , autoAcl , acls , headerFilter , locatableService , circuitBreaker , topicCalls ) ;
public class DatabasesInner { /** * Resumes 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 to be resumed . * @ 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 < DatabaseInner > beginResumeAsync ( String resourceGroupName , String serverName , String databaseName , final ServiceCallback < DatabaseInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( beginResumeWithServiceResponseAsync ( resourceGroupName , serverName , databaseName ) , serviceCallback ) ;
public class UntagResourceRequest { /** * The keys of the tags to remove from the user pool . * @ param tagKeys * The keys of the tags to remove from the user pool . */ public void setTagKeys ( java . util . Collection < String > tagKeys ) { } }
if ( tagKeys == null ) { this . tagKeys = null ; return ; } this . tagKeys = new java . util . ArrayList < String > ( tagKeys ) ;
public class SensorsParser { /** * Invokes query ( ) to do the parsing and handles parsing errors . * @ return an array of EventRecords that holds one element that represents * the current state of the hardware sensors */ public EventRecord [ ] monitor ( ) { } }
EventRecord [ ] recs = new EventRecord [ 1 ] ; try { recs [ 0 ] = query ( null ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return recs ;
public class Segment3dfx { /** * Replies the property that is the y coordinate of the second segment point . * @ return the y2 property . */ @ Pure public DoubleProperty y2Property ( ) { } }
if ( this . p2 . y == null ) { this . p2 . y = new SimpleDoubleProperty ( this , MathFXAttributeNames . Y2 ) ; } return this . p2 . y ;
public class ImgUtil { /** * { @ link Image } 转 { @ link BufferedImage } < br > * 如果源图片的RGB模式与目标模式一致 , 则直接转换 , 否则重新绘制 * @ param image { @ link Image } * @ param imageType 目标图片类型 * @ return { @ link BufferedImage } * @ since 4.3.2 */ public static BufferedImage toBufferedImage ( Image image , String imageType ) { } }
BufferedImage bufferedImage ; if ( false == imageType . equalsIgnoreCase ( IMAGE_TYPE_PNG ) ) { // 当目标为非PNG类图片时 , 源图片统一转换为RGB格式 if ( image instanceof BufferedImage ) { bufferedImage = ( BufferedImage ) image ; if ( BufferedImage . TYPE_INT_RGB != bufferedImage . getType ( ) ) { bufferedImage = copyImage ( image , BufferedImage . TYPE_INT_RGB ) ; } } else { bufferedImage = copyImage ( image , BufferedImage . TYPE_INT_RGB ) ; } } else { bufferedImage = toBufferedImage ( image ) ; } return bufferedImage ;
public class MethodCompiler { /** * Load default value to stack depending on type * @ param type * @ throws IOException */ public void loadDefault ( TypeMirror type ) throws IOException { } }
if ( type . getKind ( ) != TypeKind . VOID ) { if ( Typ . isPrimitive ( type ) ) { tconst ( type , 0 ) ; } else { aconst_null ( ) ; } }
public class DatatypeConverter { /** * Print an earned value method . * @ param value EarnedValueMethod instance * @ return earned value method value */ public static final BigInteger printEarnedValueMethod ( EarnedValueMethod value ) { } }
return ( value == null ? BigInteger . valueOf ( EarnedValueMethod . PERCENT_COMPLETE . getValue ( ) ) : BigInteger . valueOf ( value . getValue ( ) ) ) ;
public class RedshiftDatabaseMarshaller { /** * Marshall the given parameter object . */ public void marshall ( RedshiftDatabase redshiftDatabase , ProtocolMarshaller protocolMarshaller ) { } }
if ( redshiftDatabase == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( redshiftDatabase . getDatabaseName ( ) , DATABASENAME_BINDING ) ; protocolMarshaller . marshall ( redshiftDatabase . getClusterIdentifier ( ) , CLUSTERIDENTIFIER_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ExtensionLoader { /** * Gets the { @ code Extension } with the given name . * @ param name the name of the { @ code Extension } . * @ return the { @ code Extension } or { @ code null } if not found / enabled . * @ see # getExtension ( Class ) */ public Extension getExtension ( String name ) { } }
if ( name != null ) { for ( int i = 0 ; i < extensionList . size ( ) ; i ++ ) { Extension p = getExtension ( i ) ; if ( p . getName ( ) . equalsIgnoreCase ( name ) ) { return p ; } } } return null ;
public class ScribeIndex { /** * Registers a component scribe . * @ param scribe the scribe to register */ public void register ( ICalComponentScribe < ? extends ICalComponent > scribe ) { } }
experimentalCompByName . put ( scribe . getComponentName ( ) . toUpperCase ( ) , scribe ) ; experimentalCompByClass . put ( scribe . getComponentClass ( ) , scribe ) ;
public class Example { /** * KeysColSpecifiers get sent as Strings and returned as objects also containing a list of Frames that the col must be a member of , * so they need a custom GSON serializer . * private static class ColSpecifierSerializer implements JsonSerializer < ColSpecifierV3 > { * public JsonElement serialize ( ColSpecifierV3 cs , Type t , JsonSerializationContext context ) { * return new JsonPrimitive ( cs . column _ name ) ; */ public static JobV3 poll ( Retrofit retrofit , String job_id ) { } }
Jobs jobsService = retrofit . create ( Jobs . class ) ; Response < JobsV3 > jobsResponse = null ; int retries = 3 ; JobsV3 jobs = null ; do { try { jobsResponse = jobsService . fetch ( job_id ) . execute ( ) ; } catch ( IOException e ) { System . err . println ( "Caught exception: " + e ) ; } if ( ! jobsResponse . isSuccessful ( ) ) if ( retries -- > 0 ) continue ; else throw new RuntimeException ( "/3/Jobs/{job_id} failed 3 times." ) ; jobs = jobsResponse . body ( ) ; if ( null == jobs . jobs || jobs . jobs . length != 1 ) throw new RuntimeException ( "Failed to find Job: " + job_id ) ; if ( ! "RUNNING" . equals ( jobs . jobs [ 0 ] . status ) ) try { Thread . sleep ( 100 ) ; } catch ( InterruptedException e ) { } // wait 100mS } while ( "RUNNING" . equals ( jobs . jobs [ 0 ] . status ) ) ; return jobs . jobs [ 0 ] ;
public class QueryImpl { /** * ( non - Javadoc ) * @ see javax . persistence . Query # getParameter ( int , java . lang . Class ) */ @ Override public < T > Parameter < T > getParameter ( int paramInt , Class < T > paramClass ) { } }
onNativeCondition ( ) ; getParameters ( ) ; Parameter parameter = getParameterByOrdinal ( paramInt ) ; return onTypeCheck ( paramClass , parameter ) ;
public class Directory { /** * Indicates whether the specified tag type has been set . * @ param tagType the tag type to check for * @ return true if a value exists for the specified tag type , false if not */ @ java . lang . SuppressWarnings ( { } }
"UnnecessaryBoxing" } ) public boolean containsTag ( int tagType ) { return _tagMap . containsKey ( Integer . valueOf ( tagType ) ) ;
public class SimpleArrayMap { /** * Add a new value to the array map . * @ param key The key under which to store the value . < b > Must not be null . < / b > If * this key already exists in the array , its value will be replaced . * @ param value The value to store for the given key . * @ return Returns the old value that was stored for the given key , or null if there * was no such key . */ public V put ( K key , V value ) { } }
final int hash ; int index ; if ( key == null ) { hash = 0 ; index = indexOfNull ( ) ; } else { hash = key . hashCode ( ) ; index = indexOf ( key , hash ) ; } if ( index >= 0 ) { index = ( index << 1 ) + 1 ; final V old = ( V ) mArray [ index ] ; mArray [ index ] = value ; return old ; } index = ~ index ; if ( mSize >= mHashes . length ) { final int n = mSize >= ( BASE_SIZE * 2 ) ? ( mSize + ( mSize >> 1 ) ) : ( mSize >= BASE_SIZE ? ( BASE_SIZE * 2 ) : BASE_SIZE ) ; final int [ ] ohashes = mHashes ; final Object [ ] oarray = mArray ; allocArrays ( n ) ; if ( mHashes . length > 0 ) { System . arraycopy ( ohashes , 0 , mHashes , 0 , ohashes . length ) ; System . arraycopy ( oarray , 0 , mArray , 0 , oarray . length ) ; } freeArrays ( ohashes , oarray , mSize ) ; } if ( index < mSize ) { System . arraycopy ( mHashes , index , mHashes , index + 1 , mSize - index ) ; System . arraycopy ( mArray , index << 1 , mArray , ( index + 1 ) << 1 , ( mSize - index ) << 1 ) ; } mHashes [ index ] = hash ; mArray [ index << 1 ] = key ; mArray [ ( index << 1 ) + 1 ] = value ; mSize ++ ; return null ;
public class ColorValidator { /** * Validates the Pattern constraint of ' < em > Hex Color < / em > ' . * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public boolean validateHexColor_Pattern ( String hexColor , DiagnosticChain diagnostics , Map < Object , Object > context ) { } }
return validatePattern ( ColorPackage . Literals . HEX_COLOR , hexColor , HEX_COLOR__PATTERN__VALUES , diagnostics , context ) ;
public class CommandLine { /** * Adds the specified environment variables . * @ param environment the variables to add * @ throws IllegalArgumentException if any value given is null ( unsupported ) */ public void setEnvironmentVariables ( Map < String , String > environment ) { } }
for ( Map . Entry < String , String > entry : environment . entrySet ( ) ) { setEnvironmentVariable ( entry . getKey ( ) , entry . getValue ( ) ) ; }
public class XmlNamespaceDictionary { /** * Returns the namespace URI to use for serialization for a given namespace alias , possibly using * a predictable made - up namespace URI if the alias is not recognized . * < p > Specifically , if the namespace alias is not recognized , the namespace URI returned will be * { @ code " http : / / unknown / " } plus the alias , unless { @ code errorOnUnknown } is { @ code true } in * which case it will throw an { @ link IllegalArgumentException } . * @ param errorOnUnknown whether to thrown an exception if the namespace alias is not recognized * @ param alias namespace alias * @ return namespace URI , using a predictable made - up namespace URI if the namespace alias is not * recognized * @ throws IllegalArgumentException if the namespace alias is not recognized and { @ code * errorOnUnkown } is { @ code true } */ String getNamespaceUriForAliasHandlingUnknown ( boolean errorOnUnknown , String alias ) { } }
String result = getUriForAlias ( alias ) ; if ( result == null ) { Preconditions . checkArgument ( ! errorOnUnknown , "unrecognized alias: %s" , alias . length ( ) == 0 ? "(default)" : alias ) ; return "http://unknown/" + alias ; } return result ;
public class LLongSupplierBuilder { /** * Builds the functional interface implementation and if previously provided calls the consumer . */ @ Nonnull public final LLongSupplier build ( ) { } }
final LLongSupplier eventuallyFinal = this . eventually ; LLongSupplier retval ; final Case < LBoolSupplier , LLongSupplier > [ ] casesArray = cases . toArray ( new Case [ cases . size ( ) ] ) ; retval = LLongSupplier . longSup ( ( ) -> { try { for ( Case < LBoolSupplier , LLongSupplier > aCase : casesArray ) { if ( aCase . casePredicate ( ) . getAsBool ( ) ) { return aCase . caseFunction ( ) . getAsLong ( ) ; } } return eventuallyFinal . getAsLong ( ) ; } catch ( Error e ) { // NOSONAR throw e ; } catch ( Throwable e ) { // NOSONAR throw Handler . handleOrPropagate ( e , handling ) ; } } ) ; if ( consumer != null ) { consumer . accept ( retval ) ; } return retval ;
public class NameNode { /** * { @ inheritDoc } */ public void merge ( String parity , String source , String codecId , int [ ] checksums ) throws IOException { } }
namesystem . merge ( parity , source , codecId , checksums ) ; myMetrics . numFilesMerged . inc ( ) ;
public class JmsJcaConnectionImpl { /** * Creates a < code > JmsJcaSession < / code > that shares the core connection * from this connection . When first called it returns the session that was * created when this connection was requested . On subsequent calls , * constructs a < code > JmsJcaConnectionRequestInfo < / code > containing this * connection . This is passed , along with managed connection factory from * the parent connection factory , to the < code > allocateConnection < / code > * method on the connection manager which returns a session . In either case * the transacted flag is set on the session before it is returned . * @ param transacted * a flag indicating whether , in the absence of a global or * container local transaction , work should be performed inside * an application local transaction * @ return the session * @ throws ResourceException * if the JCA runtime fails to allocate a managed connection * @ throws IllegalStateException * if this connection has been closed * @ throws SIException * if the core connection cannot be cloned * @ throws SIErrorException * if the core connection cannot be cloned */ @ Override synchronized public JmsJcaSession createSession ( boolean transacted ) throws ResourceException , IllegalStateException , SIException , SIErrorException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , "createSession" , new Object [ ] { Boolean . valueOf ( transacted ) } ) ; } JmsJcaSessionImpl session ; if ( connectionClosed ) { throw new IllegalStateException ( NLS . getFormattedMessage ( ( "ILLEGAL_STATE_CWSJR1085" ) , new Object [ ] { "createSession" } , null ) ) ; } // If the firstSessionCached is true and the thread it was created on is different // to the current thread this method is called on then change the cached boolean // and delete the session as we don ' t want access to it // PK57931 also remove the cached session if the current tx is different to the one // at session create time . // If we are not running in was the blow away the cached connection too . if ( firstSessionCached && ( ( ! ( Thread . currentThread ( ) . equals ( _connectionCreateThread ) && isCurrentUOW ( _connectionCreateUOW ) ) ) || ( ! isRunningInWAS ( ) ) ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) SibTr . debug ( TRACE , "clearing first session" ) ; firstSessionCached = false ; _connectionCreateUOW = null ; _connectionCreateThread = null ; // remove the session // it should be the only one in the set , but check first if ( _sessions . size ( ) == 1 ) { final Iterator iterator = _sessions . iterator ( ) ; final Object object = iterator . next ( ) ; if ( ! ( object instanceof JmsJcaSessionImpl ) ) { throw new ResourceAdapterInternalException ( NLS . getFormattedMessage ( ( "EXCEPTION_RECEIVED_CWSJR1083" ) , new Object [ ] { "createSession" , object . getClass ( ) . getName ( ) , getClass ( ) . getName ( ) } , null ) ) ; } session = ( JmsJcaSessionImpl ) object ; session . close ( false ) ; _sessions . clear ( ) ; } else { throw new ResourceAdapterInternalException ( NLS . getFormattedMessage ( ( "EXCEPTION_RECEIVED_CWSJR1082" ) , new Object [ ] { "createSession" , "" + _sessions . size ( ) } , null ) ) ; } } // If this is the first call to this method we can return the session // that was created before ( which should be the only session in the // set ) . We should also be on the same thread as we have reset the cached value // above if we weren ' t if ( firstSessionCached ) { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( TRACE , "Using the first session that was created as part of the createConnection process" ) ; } if ( _sessions . size ( ) != 1 ) { throw new ResourceAdapterInternalException ( NLS . getFormattedMessage ( ( "EXCEPTION_RECEIVED_CWSJR1082" ) , new Object [ ] { "createSession" , "" + _sessions . size ( ) } , null ) ) ; } final Iterator iterator = _sessions . iterator ( ) ; final Object object = iterator . next ( ) ; if ( ! ( object instanceof JmsJcaSessionImpl ) ) { throw new ResourceAdapterInternalException ( NLS . getFormattedMessage ( ( "EXCEPTION_RECEIVED_CWSJR1083" ) , new Object [ ] { "createSession" , object . getClass ( ) . getName ( ) , getClass ( ) . getName ( ) } , null ) ) ; } firstSessionCached = false ; _connectionCreateUOW = null ; _connectionCreateThread = null ; session = ( JmsJcaSessionImpl ) object ; } else { // We have already returned the initial session so we should create // a new session here . if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( this , TRACE , "We have already used the first session... creating a new one" ) ; } // Feature 169626.14 if ( _connectionFactory . isManaged ( ) ) { // True if we aren using container managed authentication boolean containerAuth = false ; // The containter managed authentication alias ( only relevant if containerAuth is true ) String containerAlias = null ; try { ConnectionManager cm = _connectionFactory . getConnectionManager ( ) ; // Obtain authentication data in case an exception is thrown . This data is then used to give a more // meaningful error message . The information is obtained now as it may be altered later on . This is // only valid when running inside WAS . if ( isRunningInWAS ( ) ) { if ( cm instanceof com . ibm . ws . jca . adapter . WSConnectionManager ) { ResourceRefInfo info = ( ( com . ibm . ws . jca . adapter . WSConnectionManager ) cm ) . getResourceRefInfo ( ) ; containerAuth = info . getAuth ( ) == com . ibm . ws . javaee . dd . common . ResourceRef . AUTH_CONTAINER ; for ( Property loginConfigProp : info . getLoginPropertyList ( ) ) if ( "DefaultPrincipalMapping" . equals ( loginConfigProp . getName ( ) ) ) containerAlias = loginConfigProp . getValue ( ) ; } } final Object object = cm . allocateConnection ( _connectionFactory . getManagedConnectionFactory ( ) , _requestInfo ) ; if ( ! ( object instanceof JmsJcaSessionImpl ) ) { throw new ResourceAdapterInternalException ( NLS . getFormattedMessage ( ( "EXCEPTION_RECEIVED_CWSJR1084" ) , new Object [ ] { "createSession" , object . getClass ( ) . getName ( ) , JmsJcaSessionImpl . class . getName ( ) } , null ) ) ; } session = ( JmsJcaSessionImpl ) object ; } catch ( final ResourceException exception ) { FFDCFilter . processException ( exception , CLASS_NAME + ".createSession" , FFDC_PROBE_1 , this ) ; Throwable cause = exception . getCause ( ) ; // This section will look at the cause of an exception thrown while creating a connection . If the cause // is a security based exeption ( SIAuthenticationException or SINotAuthorizedException ) then a new // exception is created to supply the user with more information . // pnickoll : We would like to pass the " cause " as a linked exception to the following exceptions if ( isRunningInWAS ( ) ) { if ( cause instanceof SIAuthenticationException ) { SIAuthenticationException authentEx = null ; if ( containerAuth ) { if ( containerAlias != null && ! containerAlias . isEmpty ( ) ) { authentEx = new SIAuthenticationException ( NLS . getFormattedMessage ( "CONTAINER_AUTHENTICATION_EXCEPTION_1073" , new Object [ ] { containerAlias , } , null ) ) ; } else { authentEx = new SIAuthenticationException ( NLS . getString ( "AUTHENTICATION_EXCEPTION_1077" ) ) ; } } else { authentEx = new SIAuthenticationException ( NLS . getFormattedMessage ( "APPLICATION_AUTHENTICATION_EXCEPTION_1074" , new Object [ ] { _connectionFactory . getUserName ( ) } , null ) ) ; } throw authentEx ; } else if ( cause instanceof SINotAuthorizedException ) { if ( containerAuth ) { if ( containerAlias == null ) { throw new SINotAuthorizedException ( NLS . getString ( "CONTAINER_AUTHORIZATION_EXCEPTION_1075" ) ) ; } } else { String userName = _connectionFactory . getUserName ( ) ; if ( ( userName == null ) || ( "" . equals ( userName ) ) ) { throw new SINotAuthorizedException ( NLS . getString ( "CONTAINER_AUTHORIZATION_EXCEPTION_1076" ) ) ; } } } } if ( cause instanceof SIException ) { throw ( SIException ) cause ; } else if ( cause instanceof SIErrorException ) { throw ( SIErrorException ) cause ; } throw exception ; } // The coreConnection could have been recreated during allocateConnection // if we had to create a new ManagedConnection . So reset the coreConnection // for this JmsJcaConnection if the two are different . Different means that // one is not Equivalent to the other which means different userid or different // physical connection SICoreConnection managedConnectionsCoreConnection = session . getManagedConnection ( ) . getCoreConnection ( ) ; if ( ! managedConnectionsCoreConnection . isEquivalentTo ( _coreConnection ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( this , TRACE , "New ManagedConnections coreConnection is not equivalent to our _coreConnection" ) ; } try { // We are closing the connection here for completeness . The fact that createSession // has driven us to determine that clonedconnection from this _ coreConnection is now // closed will typically mean all conversations on the physcial connection are closed . // To stop a possible issue with this _ coreConnection not being closed we will call // close now just before we overwrite it below . From the javadoc of close , calling close // on a already closed connection should have not effect , but we will catch all exceptions // to be safe . _coreConnection . close ( false ) ; } catch ( Exception e ) { // No FFDC needed if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( this , TRACE , "Exception caught while closing _coreConnection that we are replacing: " + e ) ; } } // clone the connection so that the JMSJcaConnection object uses a different // conversation to the mangedConnection , this is so the managedConnection can // control close / destroy etc without impacting the conversation doing the // jms connection / session work . _coreConnection = managedConnectionsCoreConnection . cloneConnection ( ) ; // Now reset the SIcoreConnection in the requestInfo to later calls to // createSession will pass in the new coreConnection to base further // clones on . _requestInfo . setSICoreConnection ( _coreConnection ) ; } } else { session = new JmsJcaSessionImpl ( ) ; } session . setParentConnection ( this ) ; _sessions . add ( session ) ; } session . setTransacted ( transacted ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , "createSession" , session ) ; } return session ;
public class DesignContextMenu { /** * Returns an instance of the design context menu . This is a singleton with the page scope and * is cached once created . * @ return The design context menu for the active page . */ public static DesignContextMenu getInstance ( ) { } }
Page page = ExecutionContext . getPage ( ) ; DesignContextMenu contextMenu = page . getAttribute ( DesignConstants . ATTR_DESIGN_MENU , DesignContextMenu . class ) ; if ( contextMenu == null ) { contextMenu = create ( ) ; page . setAttribute ( DesignConstants . ATTR_DESIGN_MENU , contextMenu ) ; } return contextMenu ;
public class SHE { /** * Zero ' s out memory where the key is stored . * After calling this method init ( ) needs to be called again . */ public void zeroKey ( ) { } }
for ( int i = 0 ; i < key . length ; i ++ ) { key [ i ] = 0x0 ; } for ( int i = 0 ; i < prehash . length ; i ++ ) { key [ i ] = 0x0 ; } cfg = false ;
public class TopologyAssign { /** * Backup topology assignment to ZK * todo : Do we need to do backup operation every time ? */ public void backupAssignment ( Assignment assignment , TopologyAssignEvent event ) { } }
String topologyId = event . getTopologyId ( ) ; String topologyName = event . getTopologyName ( ) ; try { StormClusterState zkClusterState = nimbusData . getStormClusterState ( ) ; // one little problem , get tasks twice when assign one topology Map < Integer , String > tasks = Cluster . get_all_task_component ( zkClusterState , topologyId , null ) ; Map < String , List < Integer > > componentTasks = JStormUtils . reverse_map ( tasks ) ; for ( Entry < String , List < Integer > > entry : componentTasks . entrySet ( ) ) { List < Integer > keys = entry . getValue ( ) ; Collections . sort ( keys ) ; } AssignmentBak assignmentBak = new AssignmentBak ( componentTasks , assignment ) ; zkClusterState . backup_assignment ( topologyName , assignmentBak ) ; } catch ( Exception e ) { LOG . warn ( "Failed to backup " + topologyId + " assignment " + assignment , e ) ; }
public class ParameterInlinePolicyMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ParameterInlinePolicy parameterInlinePolicy , ProtocolMarshaller protocolMarshaller ) { } }
if ( parameterInlinePolicy == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( parameterInlinePolicy . getPolicyText ( ) , POLICYTEXT_BINDING ) ; protocolMarshaller . marshall ( parameterInlinePolicy . getPolicyType ( ) , POLICYTYPE_BINDING ) ; protocolMarshaller . marshall ( parameterInlinePolicy . getPolicyStatus ( ) , POLICYSTATUS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ColorPicker { /** * Allows you to suppress automatic rendering of labels . Used internally by AngularFaces , too . < P > * @ return Returns the value of the attribute , or false , if it hasn ' t been set by the JSF file . */ public boolean isRenderLabel ( ) { } }
return ( boolean ) ( Boolean ) getStateHelper ( ) . eval ( PropertyKeys . renderLabel , net . bootsfaces . component . ComponentUtils . isRenderLabelDefault ( ) ) ;
public class ApikeyManager { /** * with set for roles ( protected to be hidden in js ctrls ) */ protected String serializeNowFromMap ( @ Nullable String user , long duration , @ Nullable List < String > roles , Map < String , Object > nameAndValMap ) { } }
return serializeNowFromMap ( user , duration , toArr ( roles ) , nameAndValMap ) ;
public class WebUtilities { /** * This method is required on occasion because WebSphere Portal by default escapes " & lt ; " and " & gt ; " characters for * security reasons . * Decode any escape sequences to their original character , and return the resultant string . * Eg . " cat & amp ; amp ; dog & amp ; gt ; ant " becomes " cat & amp ; dog & gt ; ant " * @ param encoded the String to decode * @ return a decoded copy of the input String . */ public static String decode ( final String encoded ) { } }
if ( encoded == null || encoded . length ( ) == 0 || encoded . indexOf ( '&' ) == - 1 ) { return encoded ; } return DECODE . translate ( encoded ) ;
public class PathNormalizer { /** * Determines all single paths of the method result recursively . All parent class and method results are analyzed as well . * @ param methodResult The method result * @ return All single path pieces */ private static List < String > determinePaths ( final MethodResult methodResult ) { } }
final List < String > paths = new LinkedList < > ( ) ; MethodResult currentMethod = methodResult ; while ( true ) { addNonBlank ( currentMethod . getPath ( ) , paths ) ; final ClassResult parentClass = currentMethod . getParentResource ( ) ; if ( parentClass == null ) break ; currentMethod = parentClass . getParentSubResourceLocator ( ) ; if ( currentMethod == null ) { addNonBlank ( parentClass . getResourcePath ( ) , paths ) ; break ; } } Collections . reverse ( paths ) ; return paths ;
public class UpdatePlanNode { /** * TODO : Members not loaded */ @ Override public void loadFromJSONObject ( JSONObject jobj , Database db ) throws JSONException { } }
super . loadFromJSONObject ( jobj , db ) ; m_updatesIndexes = jobj . getBoolean ( Members . UPDATES_INDEXES . name ( ) ) ;
public class DataSetLineageService { /** * Return the lineage inputs graph for the given tableName . * @ param tableName tableName * @ return Inputs Graph as JSON */ @ Override @ GraphTransaction public String getInputsGraph ( String tableName ) throws AtlasException { } }
LOG . info ( "Fetching lineage inputs graph for tableName={}" , tableName ) ; tableName = ParamChecker . notEmpty ( tableName , "table name" ) ; TypeUtils . Pair < String , String > typeIdPair = validateDatasetNameExists ( tableName ) ; return getInputsGraphForId ( typeIdPair . right ) ;
public class AbstractTrigger { /** * Fires the specified trigger event . < br > Calling this method is left to the sub - classes . * @ param event Trigger event to be fired . */ protected void fireTriggerEvent ( TriggerEvent event ) { } }
try { for ( TriggerListener listener : listeners ) { listener . triggerValidation ( event ) ; } } catch ( RuntimeException e ) { uncheckedExceptionHandler . handleException ( e ) ; } catch ( Error e ) { uncheckedExceptionHandler . handleError ( e ) ; }
public class JmxUtils { /** * Returns an { @ link ObjectName } for the specified object in standard * format , using the package as the domain . * @ param < T > The type of class . * @ param clazz The { @ link Class } to create an { @ link ObjectName } for . * @ return The new { @ link ObjectName } . */ public static < T > ObjectName getObjectName ( final Class < T > clazz ) { } }
final String domain = clazz . getPackage ( ) . getName ( ) ; final String className = clazz . getSimpleName ( ) ; final String objectName = domain + ":type=" + className ; LOG . debug ( "Returning object name: {}" , objectName ) ; try { return new ObjectName ( objectName ) ; } catch ( final MalformedObjectNameException e ) { // This should never , ever happen . LOG . error ( "Invalid ObjectName: " + objectName , e ) ; throw new RuntimeException ( "Could not create ObjectName?" , e ) ; }
public class CommerceNotificationTemplateUserSegmentRelUtil { /** * Returns an ordered range of all the commerce notification template user segment rels where commerceNotificationTemplateId = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result set . Thus , < code > 0 < / code > refers to the first result in the set . Setting both < code > start < / code > and < code > end < / code > to { @ link QueryUtil # ALL _ POS } will return the full result set . If < code > orderByComparator < / code > is specified , then the query will include the given ORDER BY logic . If < code > orderByComparator < / code > is absent and pagination is required ( < code > start < / code > and < code > end < / code > are not { @ link QueryUtil # ALL _ POS } ) , then the query will include the default ORDER BY logic from { @ link CommerceNotificationTemplateUserSegmentRelModelImpl } . If both < code > orderByComparator < / code > and pagination are absent , for performance reasons , the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order . * @ param commerceNotificationTemplateId the commerce notification template ID * @ param start the lower bound of the range of commerce notification template user segment rels * @ param end the upper bound of the range of commerce notification template user segment rels ( not inclusive ) * @ param orderByComparator the comparator to order the results by ( optionally < code > null < / code > ) * @ param retrieveFromCache whether to retrieve from the finder cache * @ return the ordered range of matching commerce notification template user segment rels */ public static List < CommerceNotificationTemplateUserSegmentRel > findByCommerceNotificationTemplateId ( long commerceNotificationTemplateId , int start , int end , OrderByComparator < CommerceNotificationTemplateUserSegmentRel > orderByComparator , boolean retrieveFromCache ) { } }
return getPersistence ( ) . findByCommerceNotificationTemplateId ( commerceNotificationTemplateId , start , end , orderByComparator , retrieveFromCache ) ;
public class TimeZoneNamesImpl { /** * / * ( non - Javadoc ) * @ see android . icu . text . TimeZoneNames # find ( java . lang . CharSequence , int , java . util . Set ) */ @ Override public synchronized Collection < MatchInfo > find ( CharSequence text , int start , EnumSet < NameType > nameTypes ) { } }
if ( text == null || text . length ( ) == 0 || start < 0 || start >= text . length ( ) ) { throw new IllegalArgumentException ( "bad input text or range" ) ; } NameSearchHandler handler = new NameSearchHandler ( nameTypes ) ; Collection < MatchInfo > matches ; // First try of lookup . matches = doFind ( handler , text , start ) ; if ( matches != null ) { return matches ; } // All names are not yet loaded into the trie . // We may have loaded names for formatting several time zones , // and might be parsing one of those . // Populate the parsing trie from all of the already - loaded names . addAllNamesIntoTrie ( ) ; // Second try of lookup . matches = doFind ( handler , text , start ) ; if ( matches != null ) { return matches ; } // There are still some names we haven ' t loaded into the trie yet . // Load everything now . internalLoadAllDisplayNames ( ) ; // Set default time zone location names // for time zones without explicit display names . // TODO : Should this logic be moved into internalLoadAllDisplayNames ? Set < String > tzIDs = TimeZone . getAvailableIDs ( SystemTimeZoneType . CANONICAL , null , null ) ; for ( String tzID : tzIDs ) { if ( ! _tzNamesMap . containsKey ( tzID ) ) { ZNames . createTimeZoneAndPutInCache ( _tzNamesMap , null , tzID ) ; } } addAllNamesIntoTrie ( ) ; _namesTrieFullyLoaded = true ; // Third try : we must return this one . return doFind ( handler , text , start ) ;
public class PrimaryBackupServerContext { /** * Unregisters message listeners . */ private void unregisterListeners ( ) { } }
protocol . unregisterExecuteHandler ( ) ; protocol . unregisterBackupHandler ( ) ; protocol . unregisterRestoreHandler ( ) ; protocol . unregisterCloseHandler ( ) ; protocol . unregisterMetadataHandler ( ) ;
public class DayPeriod { /** * / * [ deutsch ] * < p > Repr & auml ; sentiert einen fest definierten Tagesabschnitt ( am / pm / midnight / noon ) . < / p > * < p > Die Funktion kann entweder auf { @ code PlainTime } oder { @ code PlainTimestamp } angewandt werden . * Sonst wirft sie eine { @ code ChronoException } , wenn keine Instanz von { @ code PlainTime } gefunden wird . * Wenn diese { @ code DayPeriod } nicht f & uuml ; r eine bestimmte Sprache erzeugt wurde , dann wird die * Funktion einfach nur eines der Literale & quot ; am & quot ; , & quot ; pm & quot ; , & quot ; midnight & quot ; oder * & quot ; noon & quot ; zur & uuml ; ckgeben . < / p > * @ param width determines the text width * @ param outputContext determines in which context to format * @ return fixed textual representation of day period as function applicable on { @ code PlainTime } etc . * @ since 3.13/4.10 */ public ChronoFunction < ChronoDisplay , String > fixed ( TextWidth width , OutputContext outputContext ) { } }
return new PeriodName ( true , width , outputContext ) ;
public class TargetInstanceClient { /** * Creates a TargetInstance resource in the specified project and zone using the data included in * the request . * < p > Sample code : * < pre > < code > * try ( TargetInstanceClient targetInstanceClient = TargetInstanceClient . create ( ) ) { * ProjectZoneName zone = ProjectZoneName . of ( " [ PROJECT ] " , " [ ZONE ] " ) ; * TargetInstance targetInstanceResource = TargetInstance . newBuilder ( ) . build ( ) ; * Operation response = targetInstanceClient . insertTargetInstance ( zone , targetInstanceResource ) ; * < / code > < / pre > * @ param zone Name of the zone scoping this request . * @ param targetInstanceResource A TargetInstance resource . This resource defines an endpoint * instance that terminates traffic of certain protocols . ( = = resource _ for * beta . targetInstances = = ) ( = = resource _ for v1 . targetInstances = = ) * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ @ BetaApi public final Operation insertTargetInstance ( ProjectZoneName zone , TargetInstance targetInstanceResource ) { } }
InsertTargetInstanceHttpRequest request = InsertTargetInstanceHttpRequest . newBuilder ( ) . setZone ( zone == null ? null : zone . toString ( ) ) . setTargetInstanceResource ( targetInstanceResource ) . build ( ) ; return insertTargetInstance ( request ) ;
public class RTMPClient { /** * Sets the RTMP protocol , the default is " rtmp " . If " rtmps " or " rtmpt " are required , the appropriate client type should be selected . * @ param protocol * the protocol to set * @ throws Exception */ @ Override public void setProtocol ( String protocol ) throws Exception { } }
this . protocol = protocol ; if ( "rtmps" . equals ( protocol ) || "rtmpt" . equals ( protocol ) || "rtmpte" . equals ( protocol ) || "rtmfp" . equals ( protocol ) ) { throw new Exception ( "Unsupported protocol specified, please use the correct client for the intended protocol." ) ; }
public class MicroHessianInput { /** * Reads an arbitrary object the input stream . */ public Object readObject ( Class expectedClass ) throws IOException { } }
int tag = is . read ( ) ; switch ( tag ) { case 'N' : return null ; case 'T' : return new Boolean ( true ) ; case 'F' : return new Boolean ( false ) ; case 'I' : { int b32 = is . read ( ) ; int b24 = is . read ( ) ; int b16 = is . read ( ) ; int b8 = is . read ( ) ; return new Integer ( ( b32 << 24 ) + ( b24 << 16 ) + ( b16 << 8 ) + b8 ) ; } case 'L' : { long b64 = is . read ( ) ; long b56 = is . read ( ) ; long b48 = is . read ( ) ; long b40 = is . read ( ) ; long b32 = is . read ( ) ; long b24 = is . read ( ) ; long b16 = is . read ( ) ; long b8 = is . read ( ) ; return new Long ( ( b64 << 56 ) + ( b56 << 48 ) + ( b48 << 40 ) + ( b40 << 32 ) + ( b32 << 24 ) + ( b24 << 16 ) + ( b16 << 8 ) + b8 ) ; } case 'd' : { long b64 = is . read ( ) ; long b56 = is . read ( ) ; long b48 = is . read ( ) ; long b40 = is . read ( ) ; long b32 = is . read ( ) ; long b24 = is . read ( ) ; long b16 = is . read ( ) ; long b8 = is . read ( ) ; return new Date ( ( b64 << 56 ) + ( b56 << 48 ) + ( b48 << 40 ) + ( b40 << 32 ) + ( b32 << 24 ) + ( b24 << 16 ) + ( b16 << 8 ) + b8 ) ; } case 'S' : case 'X' : { int b16 = is . read ( ) ; int b8 = is . read ( ) ; int len = ( b16 << 8 ) + b8 ; return readStringImpl ( len ) ; } case 'B' : { if ( tag != 'B' ) throw expect ( "bytes" , tag ) ; int b16 = is . read ( ) ; int b8 = is . read ( ) ; int len = ( b16 << 8 ) + b8 ; ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; for ( int i = 0 ; i < len ; i ++ ) bos . write ( is . read ( ) ) ; return bos . toByteArray ( ) ; } default : throw new IOException ( "unknown code:" + ( char ) tag ) ; }
public class RuleOrganizer { /** * This method counts how many times each data point is used in REDUCED sequitur rule ( i . e . data * point 1 appears only in R1 and R2 , the number for data point 1 is two ) . The function will get * the occurrence time for all points , and write the result into a text file named as * " PointsNumberAfterRemoving . txt " . * @ param ts the input time series . * @ param allClassifiedMotifs the motifs classified into a same set . * @ return points count . */ public SAXPointsNumber [ ] countPointNumberAfterRemoving ( double [ ] ts , ArrayList < SameLengthMotifs > allClassifiedMotifs ) { } }
// init the data structure and copy the original values SAXPointsNumber pointsNumber [ ] = new SAXPointsNumber [ ts . length ] ; for ( int i = 0 ; i < ts . length ; i ++ ) { pointsNumber [ i ] = new SAXPointsNumber ( ) ; pointsNumber [ i ] . setPointIndex ( i ) ; pointsNumber [ i ] . setPointValue ( ts [ i ] ) ; } for ( SameLengthMotifs sameLenMotifs : allClassifiedMotifs ) { for ( SAXMotif motif : sameLenMotifs . getSameLenMotifs ( ) ) { RuleInterval pos = motif . getPos ( ) ; for ( int i = pos . getStart ( ) ; i <= pos . getEnd ( ) - 1 ; i ++ ) { pointsNumber [ i ] . setPointOccurenceNumber ( pointsNumber [ i ] . getPointOccurenceNumber ( ) + 1 ) ; } } } return pointsNumber ;
public class ZipUtil { /** * Unpacks a ZIP stream to the given directory . * The output directory must not be a file . * @ param is * inputstream for ZIP file . * @ param outputDir * output directory ( created automatically if not found ) . * @ param mapper * call - back for renaming the entries . * @ param charset * charset to use when unpacking the stream */ public static void unpack ( InputStream is , File outputDir , NameMapper mapper , Charset charset ) { } }
log . debug ( "Extracting {} into '{}'." , is , outputDir ) ; iterate ( is , new Unpacker ( outputDir , mapper ) , charset ) ;
public class EventStore { /** * A finder for Event objects in the EventStore * @ param criteria the { @ link org . owasp . appsensor . core . criteria . SearchCriteria } object to search by * @ param events the { @ link Event } objects to match on - supplied by subclasses * @ return a { @ link java . util . Collection } of { @ link org . owasp . appsensor . core . Event } objects matching the search criteria . */ public Collection < Event > findEvents ( SearchCriteria criteria , Collection < Event > events ) { } }
if ( criteria == null ) { throw new IllegalArgumentException ( "criteria must be non-null" ) ; } Collection < Event > matches = new ArrayList < Event > ( ) ; for ( Event event : events ) { if ( isMatchingEvent ( criteria , event ) ) { matches . add ( event ) ; } } return matches ;
public class MathUtil { /** * Replies the min value . * @ param values are the values to scan . * @ return the min value . */ @ Pure public static float min ( float ... values ) { } }
if ( values == null || values . length == 0 ) { return Float . NaN ; } float min = values [ 0 ] ; for ( final float v : values ) { if ( v < min ) { min = v ; } } return min ;
public class ListNotebookInstanceLifecycleConfigsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ListNotebookInstanceLifecycleConfigsRequest listNotebookInstanceLifecycleConfigsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( listNotebookInstanceLifecycleConfigsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listNotebookInstanceLifecycleConfigsRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; protocolMarshaller . marshall ( listNotebookInstanceLifecycleConfigsRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; protocolMarshaller . marshall ( listNotebookInstanceLifecycleConfigsRequest . getSortBy ( ) , SORTBY_BINDING ) ; protocolMarshaller . marshall ( listNotebookInstanceLifecycleConfigsRequest . getSortOrder ( ) , SORTORDER_BINDING ) ; protocolMarshaller . marshall ( listNotebookInstanceLifecycleConfigsRequest . getNameContains ( ) , NAMECONTAINS_BINDING ) ; protocolMarshaller . marshall ( listNotebookInstanceLifecycleConfigsRequest . getCreationTimeBefore ( ) , CREATIONTIMEBEFORE_BINDING ) ; protocolMarshaller . marshall ( listNotebookInstanceLifecycleConfigsRequest . getCreationTimeAfter ( ) , CREATIONTIMEAFTER_BINDING ) ; protocolMarshaller . marshall ( listNotebookInstanceLifecycleConfigsRequest . getLastModifiedTimeBefore ( ) , LASTMODIFIEDTIMEBEFORE_BINDING ) ; protocolMarshaller . marshall ( listNotebookInstanceLifecycleConfigsRequest . getLastModifiedTimeAfter ( ) , LASTMODIFIEDTIMEAFTER_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class EDBConverter { /** * Tests if an EDBObject has the correct model class in which it should be converted . Returns false if the model * type is not fitting , returns true if the model type is fitting or model type is unknown . */ private boolean checkEDBObjectModelType ( EDBObject object , Class < ? > model ) { } }
String modelClass = object . getString ( EDBConstants . MODEL_TYPE ) ; if ( modelClass == null ) { LOGGER . warn ( String . format ( "The EDBObject with the oid %s has no model type information." + "The resulting model may be a different model type than expected." , object . getOID ( ) ) ) ; } if ( modelClass != null && ! modelClass . equals ( model . getName ( ) ) ) { return false ; } return true ;
public class V1InstanceCreator { /** * Create a new iteration with a name , begin date , and end date . * @ param name The name of the iteration . * @ param schedule The schedule this iteration belongs to . * @ param beginDate The begin date or start date of this iteration . * @ param endDate The end date of this iteration . * @ return A newly minted Iteration that exists in the VersionOne system . */ public Iteration iteration ( String name , Schedule schedule , DateTime beginDate , DateTime endDate ) { } }
return iteration ( name , schedule , beginDate , endDate , null ) ;
public class XPathBuilder { /** * < p > < b > Used for finding element process ( to generate xpath address ) < / b > < / p > * < p > Result Example : < / p > * < pre > * / / * [ @ type = ' type ' ] * < / pre > * @ param type eg . ' checkbox ' or ' button ' * @ param < T > the element which calls this method * @ return this element */ @ SuppressWarnings ( "unchecked" ) public < T extends XPathBuilder > T setType ( final String type ) { } }
this . type = type ; return ( T ) this ;
public class DescribeTapeRecoveryPointsResult { /** * An array of TapeRecoveryPointInfos that are available for the specified gateway . * @ return An array of TapeRecoveryPointInfos that are available for the specified gateway . */ public java . util . List < TapeRecoveryPointInfo > getTapeRecoveryPointInfos ( ) { } }
if ( tapeRecoveryPointInfos == null ) { tapeRecoveryPointInfos = new com . amazonaws . internal . SdkInternalList < TapeRecoveryPointInfo > ( ) ; } return tapeRecoveryPointInfos ;
public class HttpTunnelPayload { /** * Write the content of this payload to the given target channel . * @ param channel the channel to write to * @ throws IOException in case of I / O errors */ public void writeTo ( WritableByteChannel channel ) throws IOException { } }
Assert . notNull ( channel , "Channel must not be null" ) ; while ( this . data . hasRemaining ( ) ) { channel . write ( this . data ) ; }
public class BaseRTMPClientHandler { /** * Dynamic streaming play method . * The following properties are supported on the play options : * < pre > * streamName : String . The name of the stream to play or the new stream to switch to . * oldStreamName : String . The name of the initial stream that needs to be switched out . This is not needed and ignored * when play2 is used for just playing the stream and not switching to a new stream . * start : Number . The start time of the new stream to play , just as supported by the existing play API . and it has the * same defaults . This is ignored when the method is called for switching ( in other words , the transition * is either NetStreamPlayTransition . SWITCH or NetStreamPlayTransitions . SWAP ) * len : Number . The duration of the playback , just as supported by the existing play API and has the same defaults . * transition : String . The transition mode for the playback command . It could be one of the following : * NetStreamPlayTransitions . RESET * NetStreamPlayTransitions . APPEND * NetStreamPlayTransitions . SWITCH * NetStreamPlayTransitions . SWAP * < / pre > * NetStreamPlayTransitions : * < pre > * APPEND : String = " append " - Adds the stream to a playlist and begins playback with the first stream . * APPEND _ AND _ WAIT : String = " appendAndWait " - Builds a playlist without starting to play it from the first stream . * RESET : String = " reset " - Clears any previous play calls and plays the specified stream immediately . * RESUME : String = " resume " - Requests data from the new connection starting from the point at which the previous connection ended . * STOP : String = " stop " - Stops playing the streams in a playlist . * SWAP : String = " swap " - Replaces a content stream with a different content stream and maintains the rest of the playlist . * SWITCH : String = " switch " - Switches from playing one stream to another stream , typically with streams of the same content . * < / pre > * @ see < a href = " http : / / www . adobe . com / devnet / flashmediaserver / articles / dynstream _ actionscript . html " > ActionScript guide to dynamic * streaming < / a > * @ see < a * href = " http : / / help . adobe . com / en _ US / FlashPlatform / reference / actionscript / 3 / flash / net / NetStreamPlayTransitions . html " > NetStreamPlayTransitions < / a > */ @ Override public void play2 ( Number streamId , Map < String , ? > playOptions ) { } }
log . debug ( "play2 options: {}" , playOptions . toString ( ) ) ; /* { streamName = streams / new . flv , oldStreamName = streams / old . flv , start = 0 , len = - 1, offset = 12.195, transition = switch } */ // get the transition type String transition = ( String ) playOptions . get ( "transition" ) ; if ( conn != null ) { if ( "NetStreamPlayTransitions.STOP" . equals ( transition ) ) { PendingCall pendingCall = new PendingCall ( "play" , new Object [ ] { Boolean . FALSE } ) ; conn . invoke ( pendingCall , getChannelForStreamId ( streamId ) ) ; } else if ( "NetStreamPlayTransitions.RESET" . equals ( transition ) ) { // just reset the currently playing stream } else { Object [ ] params = new Object [ 6 ] ; params [ 0 ] = playOptions . get ( "streamName" ) . toString ( ) ; Object o = playOptions . get ( "start" ) ; params [ 1 ] = o instanceof Integer ? ( Integer ) o : Integer . valueOf ( ( String ) o ) ; o = playOptions . get ( "len" ) ; params [ 2 ] = o instanceof Integer ? ( Integer ) o : Integer . valueOf ( ( String ) o ) ; // new parameters for playback params [ 3 ] = transition ; params [ 4 ] = playOptions . get ( "offset" ) ; params [ 5 ] = playOptions . get ( "oldStreamName" ) ; // do call PendingCall pendingCall = new PendingCall ( "play2" , params ) ; conn . invoke ( pendingCall , getChannelForStreamId ( streamId ) ) ; } } else { log . info ( "Connection was null ?" ) ; }
public class BaseConvertToNative { /** * Move the standard payload properties from the message to the xml . * @ param message * @ param msg */ public void setPayloadProperties ( BaseMessage message , Object msg ) { } }
MessageDataDesc messageDataDesc = message . getMessageDataDesc ( null ) ; // Top level only if ( messageDataDesc != null ) { Map < String , Class < ? > > mapPropertyNames = messageDataDesc . getPayloadPropertyNames ( null ) ; if ( mapPropertyNames != null ) { for ( String strKey : mapPropertyNames . keySet ( ) ) { Class < ? > classKey = mapPropertyNames . get ( strKey ) ; this . setPayloadProperty ( message , msg , strKey , classKey ) ; } } } if ( message . get ( "Version" ) == null ) this . setPayloadProperty ( DEFAULT_VERSION , msg , "Version" , Float . class ) ; this . setPayloadProperty ( this . getTimeStamp ( ) , msg , "TimeStamp" , org . joda . time . DateTime . class ) ; // Current timestamp
public class MetricRegistryImpl { /** * Adds the metric name to an application map . * This map is not a complete list of metrics owned by an application , * produced metrics are managed in the MetricsExtension * @ param name */ protected void addNameToApplicationMap ( String name ) { } }
String appName = getApplicationName ( ) ; // If it is a base metric , the name will be null if ( appName == null ) return ; ConcurrentLinkedQueue < String > list = applicationMap . get ( appName ) ; if ( list == null ) { ConcurrentLinkedQueue < String > newList = new ConcurrentLinkedQueue < String > ( ) ; list = applicationMap . putIfAbsent ( appName , newList ) ; if ( list == null ) list = newList ; } list . add ( name ) ;
public class DefaultShardManagerBuilder { /** * Adds the provided listener providers to the list of listener providers that will be used to create listeners . * On shard creation ( including shard restarts ) each provider will have the shard id applied and must return a listener , * which will be used , along all other listeners , to populate the listeners of the JDA object of that shard . * < br > This uses the { @ link net . dv8tion . jda . core . hooks . InterfacedEventManager InterfacedEventListener } by default . * < br > To switch to the { @ link net . dv8tion . jda . core . hooks . AnnotatedEventManager AnnotatedEventManager } , * use { @ link # setEventManagerProvider ( IntFunction ) setEventManager ( id - > new AnnotatedEventManager ( ) ) } . * < p > < b > Note : < / b > When using the { @ link net . dv8tion . jda . core . hooks . InterfacedEventManager InterfacedEventListener } ( default ) , * given listener ( s ) < b > must < / b > be instance of { @ link net . dv8tion . jda . core . hooks . EventListener EventListener } ! * @ param listenerProviders * The listener provider to add to the list of listener providers . * @ return The DefaultShardManagerBuilder instance . Useful for chaining . */ public DefaultShardManagerBuilder addEventListenerProviders ( final Collection < IntFunction < Object > > listenerProviders ) { } }
Checks . noneNull ( listenerProviders , "listener providers" ) ; this . listenerProviders . addAll ( listenerProviders ) ; return this ;
public class GetPortRequest { /** * ( non - Javadoc ) * @ see * com . emc . ecs . nfsclient . rpc . RpcRequest # marshalling ( com . emc . ecs . nfsclient . * rpc . Xdr ) */ public void marshalling ( Xdr x ) { } }
super . marshalling ( x ) ; x . putInt ( _programToQuery ) ; x . putInt ( _programVersion ) ; x . putInt ( _networkProtocol ) ; x . putInt ( _port ) ;
public class GenericMapAttribute { /** * Parse the given projection . * @ param projection The projection string . * @ param longitudeFirst longitudeFirst */ public static CoordinateReferenceSystem parseProjection ( final String projection , final Boolean longitudeFirst ) { } }
try { if ( longitudeFirst == null ) { return CRS . decode ( projection ) ; } else { return CRS . decode ( projection , longitudeFirst ) ; } } catch ( NoSuchAuthorityCodeException e ) { throw new RuntimeException ( projection + " was not recognized as a crs code" , e ) ; } catch ( FactoryException e ) { throw new RuntimeException ( "Error occurred while parsing: " + projection , e ) ; }
public class PollingWait { /** * Default : 30 seconds . */ public PollingWait timeoutAfter ( long timeAmount , @ Nonnull TimeUnit timeUnit ) { } }
if ( timeAmount <= 0 ) { throw new IllegalArgumentException ( "Invalid timeAmount: " + timeAmount + " -- must be greater than 0" ) ; } timeoutMillis = timeUnit . toMillis ( timeAmount ) ; return this ;
public class XAnnotationInvocationHandler { /** * Returns an object ' s invocation handler if that object is a dynamic proxy * with a handler of type AnnotationInvocationHandler . Returns null * otherwise . */ private XAnnotationInvocationHandler asOneOfUs ( Object o ) { } }
if ( Proxy . isProxyClass ( o . getClass ( ) ) ) { InvocationHandler handler = Proxy . getInvocationHandler ( o ) ; if ( handler instanceof XAnnotationInvocationHandler ) return ( XAnnotationInvocationHandler ) handler ; } return null ;
public class QueryStateMachine { /** * Created QueryStateMachines must be transitioned to terminal states to clean up resources . */ public static QueryStateMachine begin ( String query , Session session , URI self , ResourceGroupId resourceGroup , Optional < QueryType > queryType , boolean transactionControl , TransactionManager transactionManager , AccessControl accessControl , Executor executor , Metadata metadata , WarningCollector warningCollector ) { } }
return beginWithTicker ( query , session , self , resourceGroup , queryType , transactionControl , transactionManager , accessControl , executor , Ticker . systemTicker ( ) , metadata , warningCollector ) ;