signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class RespondActivityTaskCompletedRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( RespondActivityTaskCompletedRequest respondActivityTaskCompletedRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( respondActivityTaskCompletedRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( respondActivityTaskCompletedRequest . getTaskToken ( ) , TASKTOKEN_BINDING ) ; protocolMarshaller . marshall ( respondActivityTaskCompletedRequest . ...
public class RestfulServer { /** * Register a group of providers . These could be Resource Providers ( classes implementing { @ link IResourceProvider } ) or " plain " providers , or a mixture of the two . * @ param theProviders a { @ code Collection } of theProviders . The parameter could be null or an empty { @ cod...
Validate . noNullElements ( theProviders ) ; registerProviders ( Arrays . asList ( theProviders ) ) ;
public class PolicyAssignmentsInner { /** * Creates a policy assignment . * Policy assignments are inherited by child resources . For example , when you apply a policy to a resource group that policy is assigned to all resources in the group . * @ param scope The scope of the policy assignment . * @ param policyA...
return createWithServiceResponseAsync ( scope , policyAssignmentName , parameters ) . map ( new Func1 < ServiceResponse < PolicyAssignmentInner > , PolicyAssignmentInner > ( ) { @ Override public PolicyAssignmentInner call ( ServiceResponse < PolicyAssignmentInner > response ) { return response . body ( ) ; } } ) ;
public class CodeBuilderFactory { /** * Create a synthetic resource . * @ param resourceSet the resourceSet . * @ return the resource . */ @ Pure protected Resource createResource ( ResourceSet resourceSet ) { } }
URI uri = computeUnusedUri ( resourceSet ) ; Resource resource = getResourceFactory ( ) . createResource ( uri ) ; resourceSet . getResources ( ) . add ( resource ) ; return resource ;
public class CacheHandler { /** * MSI end */ public void addRules ( RuleHandler ruleHandler ) { } }
ruleHandler . addRule ( "display-name" , new DisplayNameHandler ( ) ) ; ruleHandler . addRule ( "description" , new DescriptionHandler ( ) ) ; ruleHandler . addRule ( "cache-instance" , new CacheInstanceHandler ( ) ) ; // MSI ruleHandler . addRule ( "cache-entry" , new CacheEntryHandler ( this ) ) ; ruleHandler . addRu...
public class HeartAbleConnectionListener { /** * 重置心跳发送序号 * @ param conn */ protected final void resetHeartSeq ( JConnection conn ) { } }
if ( conn . hasAttribute ( IdleConnectionKey . HeartConfig ) ) { // 重置心跳序号 HeartConfig hc = ( HeartConfig ) conn . getAttribute ( IdleConnectionKey . HeartConfig ) ; hc . setSeq ( 0 ) ; }
public class RythmConfiguration { /** * Return { @ link RythmConfigurationKey # CODEGEN _ BYTE _ CODE _ ENHANCER } without lookup * @ return the byte code enhancer implementation */ public IByteCodeEnhancer byteCodeEnhancer ( ) { } }
if ( IByteCodeEnhancer . INSTS . NULL == _byteCodeEnhancer ) { _byteCodeEnhancer = get ( CODEGEN_BYTE_CODE_ENHANCER ) ; } return _byteCodeEnhancer ;
public class AbstractIoBuffer { /** * { @ inheritDoc } */ @ Override public final IoBuffer putLong ( int index , long value ) { } }
autoExpand ( index , 8 ) ; buf ( ) . putLong ( index , value ) ; return this ;
public class BeanDefinitionParser { /** * parsePropertySubElement . * @ param ele a { @ link org . w3c . dom . Element } object . * @ param bd a { @ link org . springframework . beans . factory . config . BeanDefinition } object . * @ return a { @ link java . lang . Object } object . */ public Object parsePropert...
return parsePropertySubElement ( ele , bd , null ) ;
public class DocClient { /** * delete a Document . * @ param documentId The document id . * @ return A DeleteDocumentResponse object containing the information returned by Document . */ public DeleteDocumentResponse deleteDocument ( String documentId ) { } }
DeleteDocumentRequest request = new DeleteDocumentRequest ( ) ; request . setDocumentId ( documentId ) ; return this . deleteDocument ( request ) ;
public class ListManagementTermListsImpl { /** * Updates an Term List . * @ param listId List Id of the image list . * @ param contentType The content type . * @ param bodyParameter Schema of the body . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws ...
return ServiceFuture . fromResponse ( updateWithServiceResponseAsync ( listId , contentType , bodyParameter ) , serviceCallback ) ;
public class RetryHandler { /** * Run the specified method , retrying on failure . * @ param runner JUnit test runner * @ param method test method to be run * @ param notifier run notifier through which events are published * @ param maxRetry maximum number of retry attempts */ static void runChildWithRetry ( O...
boolean doRetry = false ; Statement statement = invoke ( runner , "methodBlock" , method ) ; Description description = invoke ( runner , "describeChild" , method ) ; AtomicInteger count = new AtomicInteger ( maxRetry ) ; do { EachTestNotifier eachNotifier = new EachTestNotifier ( notifier , description ) ; eachNotifier...
public class JpaControllerManagement { /** * ActionStatus updates are allowed mainly if the action is active . If the * action is not active we accept further status updates if permitted so * by repository configuration . In this case , only the values : Status . ERROR * and Status . FINISHED are allowed . In the...
final boolean isIntermediateFeedback = ! FINISHED . equals ( actionStatus . getStatus ( ) ) && ! Status . ERROR . equals ( actionStatus . getStatus ( ) ) ; final boolean isAllowedByRepositoryConfiguration = ! repositoryProperties . isRejectActionStatusForClosedAction ( ) && isIntermediateFeedback ; final boolean isAllo...
public class StringUtils { /** * 自动填充 * 比如 : 待填充字符串 : Dd , 用x在其左侧填充成10位的字符串 , * 则为 : xxxxxDd * 如果待字符串is null , 则返回null 。 * 如果填充长度is null , 或者小于原长度 , 则返回原待填充字符串 。 * 例如 : 待填充字符串 : Dd , 用x在其左侧填充成10位的字符串 , 则仍然为 : Dd * 如果你有指定填充字符串 , 或者填充方向 , 我们会进行默认 。 * 填充字符串默认为 : 0 , 方向为 : 左 。 * 例如 : 待填充字符串 : Dd , 填充成10位的字符...
// 初始化校验 if ( source == null || length == null || ( source + "" ) . length ( ) >= length ) return source + "" ; // 指定填充字符 if ( isEmpty ( str ) ) str = "0" ; // 指定填充方向 if ( isRight == null ) isRight = false ; // 字符填充长度 int count = ( source + "" ) . length ( ) ; StringBuilder sb = new StringBuilder ( length ) ; // 右填充 if...
public class CreateDlpJobRequest { /** * < code > . google . privacy . dlp . v2 . InspectJobConfig inspect _ job = 2 ; < / code > */ public com . google . privacy . dlp . v2 . InspectJobConfig getInspectJob ( ) { } }
if ( jobCase_ == 2 ) { return ( com . google . privacy . dlp . v2 . InspectJobConfig ) job_ ; } return com . google . privacy . dlp . v2 . InspectJobConfig . getDefaultInstance ( ) ;
public class BaseAction { /** * Creates a new instance of BaseAction . * @ param actionKey The menu description key for this item . */ public void init ( String actionKey , ActionListener targetListener ) { } }
m_targetListener = targetListener ; m_actionKey = actionKey ; String text = BaseApplet . getSharedInstance ( ) . getString ( actionKey ) ; String desc = BaseApplet . getSharedInstance ( ) . getString ( actionKey + TIP ) ; ImageIcon icon = BaseApplet . getSharedInstance ( ) . loadImageIcon ( actionKey ) ; ActionManager ...
public class AbstractFolderTreeItemFactory { /** * This implementation is different , because the root object is also put into * the item store . */ @ Nonnull public final ITEMTYPE createRoot ( ) { } }
final ITEMTYPE aItem = internalCreateRoot ( ) ; return addToItemStore ( aItem . getGlobalUniqueDataID ( ) , aItem ) ;
public class CommerceNotificationQueueEntryLocalServiceBaseImpl { /** * Creates a new commerce notification queue entry with the primary key . Does not add the commerce notification queue entry to the database . * @ param commerceNotificationQueueEntryId the primary key for the new commerce notification queue entry ...
return commerceNotificationQueueEntryPersistence . create ( commerceNotificationQueueEntryId ) ;
public class CredentialListReader { /** * Make the request to the Twilio API to perform the read . * @ param client TwilioRestClient with which to make the request * @ return CredentialList ResourceSet */ @ Override public ResourceSet < CredentialList > read ( final TwilioRestClient client ) { } }
return new ResourceSet < > ( this , client , firstPage ( client ) ) ;
public class PairAbstractionConverter { /** * Adds all of the abstraction definitions for which the given complex * abstraction instance defines a temporal relation to the given complex * abstraction definition . * @ param complexAbstractionInstance * a Protege complex abstraction < code > Instance < / code > ....
ConnectionManager cm = backend . getConnectionManager ( ) ; Instance relationInstance = ( Instance ) cm . getOwnSlotValue ( pairAbstractionInstance , cm . getSlot ( "withRelation" ) ) ; if ( relationInstance != null ) { Relation relation = Util . instanceToRelation ( relationInstance , cm , backend ) ; Instance lhs = (...
public class NetworkFilter { /** * { @ inheritDoc } */ @ Override public NetworkFilter or ( NetworkFilter otherFilter ) { } }
checkNotNull ( otherFilter , "Other filter must be not a null" ) ; evaluation = new OrEvaluation < > ( evaluation , otherFilter , NetworkMetadata :: getId ) ; return this ;
public class AbstractScanPlanNode { /** * When a project node is added to the top of the plan , we need to adjust * the differentiator field of TVEs to reflect differences in the scan * schema vs the storage schema of a table , so that fields with duplicate names * produced by expanding " SELECT * " can resolve c...
int storageIndex = tve . getColumnIndex ( ) ; Integer scanIndex = m_differentiatorMap . get ( storageIndex ) ; assert ( scanIndex != null ) ; tve . setDifferentiator ( storageIndex ) ;
public class ServletErrorReport { /** * This method determines if the error is initiated by an application or not . * @ param rootEx the exception being tested * @ return true if a nice friendly app error should be returned , false otherwise . */ private boolean isApplicationError ( Throwable rootEx , String pkgRoo...
if ( rootEx != null ) { StackTraceElement [ ] stackTrace = rootEx . getStackTrace ( ) ; if ( stackTrace != null && stackTrace . length > 0 ) { StackTraceElement rootThrower = stackTrace [ 0 ] ; String className = rootThrower . getClassName ( ) ; if ( className != null && ! ! ! className . startsWith ( pkgRoot ) ) { ret...
public class FixedLengthRecordMapper { /** * utility method to calculate field offsets used to extract fields from record . */ private int [ ] calculateOffsets ( final int [ ] lengths ) { } }
int [ ] offsets = new int [ lengths . length + 1 ] ; offsets [ 0 ] = 0 ; for ( int i = 0 ; i < lengths . length ; i ++ ) { offsets [ i + 1 ] = offsets [ i ] + lengths [ i ] ; } return offsets ;
public class ClassInfoField { /** * Set up the default screen control for this field . * @ param itsLocation Location of this component on screen ( ie . , GridBagConstraint ) . * @ param targetScreen Where to place this component ( ie . , Parent screen or GridBagLayout ) . * @ param converter The converter to set...
return this . setupTableLookup ( itsLocation , targetScreen , converter , iDisplayFieldDesc , this . makeReferenceRecord ( ) , ClassInfo . CLASS_NAME_KEY , ClassInfo . CLASS_NAME , true , true ) ;
public class JRebirth { /** * Run into the JRebirth Thread Pool [ JTP ] . * Be careful this method can be called through any thread . * @ param runnableName the name of the runnable for logging purpose * @ param runnablePriority the priority to try to apply to the runnable * @ param runnable the task to run */ ...
runIntoJTP ( new JrbReferenceRunnable ( runnableName , runnablePriority , runnable ) ) ;
public class AbstractAWSSigner { /** * Returns the time offset in seconds . */ @ Deprecated protected int getTimeOffset ( SignableRequest < ? > request ) { } }
final int globleOffset = SDKGlobalTime . getGlobalTimeOffset ( ) ; return globleOffset == 0 ? request . getTimeOffset ( ) : globleOffset ;
public class UserBS { /** * Requisição para recuperar usuário . * @ param token * Token de identificação do usuário a ser recuperado . * @ return UserRecoverRequest Requisição realizada . */ public UserRecoverRequest retrieveRecoverRequest ( String token ) { } }
UserRecoverRequest req = this . dao . exists ( token , UserRecoverRequest . class ) ; if ( req == null ) return null ; if ( req . getExpiration ( ) . getTime ( ) < System . currentTimeMillis ( ) ) return null ; if ( req . isUsed ( ) ) return null ; return req ;
public class ParserTokenStream { /** * Consumes all tokens until the token at the front of the stream is of one of the given types . * @ param types The types to cause the stream to stop consuming * @ return The list of tokens that were consumed . */ public List < ParserToken > consumeWhile ( ParserTokenType ... ty...
List < ParserToken > tokens = new ArrayList < > ( ) ; while ( isOfType ( lookAheadType ( 0 ) , types ) ) { tokens . add ( consume ( ) ) ; } return tokens ;
public class PlatformDefaultImpl { /** * @ see Platform # setObject ( PreparedStatement , int , Object , int ) */ public void setObjectForStatement ( PreparedStatement ps , int index , Object value , int sqlType ) throws SQLException { } }
if ( ( sqlType == Types . LONGVARCHAR ) && ( value instanceof String ) ) { String s = ( String ) value ; ps . setCharacterStream ( index , new StringReader ( s ) , s . length ( ) ) ; } /* PATCH for BigDecimal truncation problem . Seems that several databases ( e . g . DB2 , Sybase ) has problem with BigDecimal fields...
public class ClassInspector { /** * Gets all fields that are potential ' constants ' . * @ param aClass the class to work from * @ return all constants that could be found */ public List < ConstantField > getConstants ( Class < ? > aClass ) { } }
List < ConstantField > constants = new ArrayList < > ( ) ; List < Field > fields = Arrays . asList ( aClass . getDeclaredFields ( ) ) ; for ( Field field : fields ) { if ( Modifier . isStatic ( field . getModifiers ( ) ) && ! Modifier . isFinal ( field . getModifiers ( ) ) ) { if ( ! Modifier . isPublic ( field . getMo...
public class TwoDimensionalCounter { /** * Produces a new ConditionalCounter . * @ return a new ConditionalCounter , where order of indices is reversed */ @ SuppressWarnings ( { } }
"unchecked" } ) public static < K1 , K2 > TwoDimensionalCounter < K2 , K1 > reverseIndexOrder ( TwoDimensionalCounter < K1 , K2 > cc ) { // they typing on the outerMF is violated a bit , but it ' ll work . . . . TwoDimensionalCounter < K2 , K1 > result = new TwoDimensionalCounter < K2 , K1 > ( ( MapFactory ) cc . outer...
public class AWSKMSClient { /** * Schedules the deletion of a customer master key ( CMK ) . You may provide a waiting period , specified in days , * before deletion occurs . If you do not provide a waiting period , the default period of 30 days is used . When this * operation is successful , the key state of the CM...
request = beforeClientExecution ( request ) ; return executeScheduleKeyDeletion ( request ) ;
public class WriteCommandInstruction { /** * ( non - Javadoc ) * @ see net . roboconf . core . commands . AbstractCommandInstruction # doValidate ( ) */ @ Override public List < ParsingError > doValidate ( ) { } }
List < ParsingError > result = new ArrayList < > ( ) ; if ( Utils . isEmptyOrWhitespaces ( this . filePath ) ) result . add ( new ParsingError ( ErrorCode . CMD_MISSING_TARGET_FILE , this . context . getCommandFile ( ) , this . line ) ) ; return result ;
public class Schema { /** * Return the class of the implementation type parameter I for this Schema . * Used by generic code which deals with arbitrary schemas and their backing * impl classes . Never returns null . */ public Class < I > getImplClass ( ) { } }
return _impl_class != null ? _impl_class : ( _impl_class = ReflectionUtils . findActualClassParameter ( this . getClass ( ) , 0 ) ) ;
public class CSSStyleDeclarationImpl { /** * Remove a property . * @ param propertyName the property name * @ return the removed property * @ throws DOMException in case of error */ public String removeProperty ( final String propertyName ) throws DOMException { } }
if ( null == propertyName ) { return "" ; } for ( int i = 0 ; i < properties_ . size ( ) ; i ++ ) { final Property p = properties_ . get ( i ) ; if ( p != null && propertyName . equalsIgnoreCase ( p . getName ( ) ) ) { properties_ . remove ( i ) ; if ( p . getValue ( ) == null ) { return "" ; } return p . getValue ( ) ...
public class WebDriverHelper { /** * Waits until an element contains a specific text . * @ param by * method of identifying the element * @ param text * the element text to wait for * @ param maximumSeconds * the maximum number of seconds to wait for */ public void waitForElementToContainSpecificText ( fina...
WebDriverWait wait = new WebDriverWait ( driver , maximumSeconds ) ; wait . until ( ExpectedConditions . textToBePresentInElement ( by , text ) ) ;
public class InternalXbaseWithAnnotationsParser { /** * InternalXbaseWithAnnotations . g : 6322:1 : entryRuleJvmWildcardTypeReference returns [ EObject current = null ] : iv _ ruleJvmWildcardTypeReference = ruleJvmWildcardTypeReference EOF ; */ public final EObject entryRuleJvmWildcardTypeReference ( ) throws Recogniti...
EObject current = null ; EObject iv_ruleJvmWildcardTypeReference = null ; try { // InternalXbaseWithAnnotations . g : 6322:65 : ( iv _ ruleJvmWildcardTypeReference = ruleJvmWildcardTypeReference EOF ) // InternalXbaseWithAnnotations . g : 6323:2 : iv _ ruleJvmWildcardTypeReference = ruleJvmWildcardTypeReference EOF { i...
public class DateTimeFormatterBuilder { /** * Appends the text of a date - time field to the formatter . * The text of the field will be output during a print . * The value must be within the valid range of the field . * If the value cannot be obtained then an exception will be thrown . * If the field has no te...
Jdk8Methods . requireNonNull ( field , "field" ) ; Jdk8Methods . requireNonNull ( textStyle , "textStyle" ) ; appendInternal ( new TextPrinterParser ( field , textStyle , DateTimeTextProvider . getInstance ( ) ) ) ; return this ;
public class TypedStreamReader { /** * Method that allows reading contents of an attribute as an array * of whitespace - separate tokens , decoded using specified decoder . * @ return Number of tokens decoded , 0 if none found */ @ Override public int getAttributeAsArray ( int index , TypedArrayDecoder tad ) throws...
if ( mCurrToken != START_ELEMENT ) { throw new IllegalStateException ( ErrorConsts . ERR_STATE_NOT_STELEM ) ; } return mAttrCollector . decodeValues ( index , tad , this ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link Item } { @ code > } } */ @ XmlElementDecl ( namespace = "http://schema.intuit.com/finance/v3" , name = "Item" , substitutionHeadNamespace = "http://schema.intuit.com/finance/v3" , substitutionHeadName = "IntuitObject" ...
return new JAXBElement < Item > ( _Item_QNAME , Item . class , null , value ) ;
public class TagAttributeImpl { /** * Create a ValueExpression , using this attribute ' s literal value and the passed expected type . * @ see ExpressionFactory # createValueExpression ( javax . el . ELContext , java . lang . String , java . lang . Class ) * @ see ValueExpression * @ param ctx * FaceletContext ...
AbstractFaceletContext actx = ( AbstractFaceletContext ) ctx ; // volatile reads are atomic , so take the tuple to later comparison . Object [ ] localCachedExpression = cachedExpression ; if ( actx . isAllowCacheELExpressions ( ) && localCachedExpression != null && localCachedExpression . length == 2 ) { // If the expe...
public class Gmap3Dashboard { /** * region > notYetComplete ( derived collection ) */ @ MemberOrder ( sequence = "1" ) @ CollectionLayout ( render = RenderType . EAGERLY ) public List < Gmap3ToDoItem > getNotYetComplete ( ) { } }
return gmap3WicketToDoItems . notYetCompleteNoUi ( ) ;
public class ConnectedStreams { /** * Applies a CoFlatMap transformation on a { @ link ConnectedStreams } and * maps the output to a common type . The transformation calls a * { @ link CoFlatMapFunction # flatMap1 } for each element of the first input * and { @ link CoFlatMapFunction # flatMap2 } for each element...
TypeInformation < R > outTypeInfo = TypeExtractor . getBinaryOperatorReturnType ( coFlatMapper , CoFlatMapFunction . class , 0 , 1 , 2 , TypeExtractor . NO_INDEX , getType1 ( ) , getType2 ( ) , Utils . getCallLocationName ( ) , true ) ; return transform ( "Co-Flat Map" , outTypeInfo , new CoStreamFlatMap < > ( inputStr...
public class BufferFieldTable { /** * Move the data source buffer to all the fields . * < br / > < pre > * Make sure you do the following steps : * 1 ) Move the data fields to the correct record data fields , with mode Constants . READ _ MOVE . * 2 ) Set the data source or set to null , so I can cache the sourc...
if ( this . getDataSource ( ) == null ) throw new DBException ( Constants . INVALID_RECORD ) ; ( ( BaseBuffer ) this . getDataSource ( ) ) . resetPosition ( ) ; return super . dataToFields ( record ) ;
public class PolicySetDefinitionsInner { /** * Retrieves all policy set definitions in management group . * This operation retrieves a list of all the a policy set definition in the given management group . * @ param managementGroupId The ID of the management group . * @ throws IllegalArgumentException thrown if ...
return listByManagementGroupWithServiceResponseAsync ( managementGroupId ) . map ( new Func1 < ServiceResponse < Page < PolicySetDefinitionInner > > , Page < PolicySetDefinitionInner > > ( ) { @ Override public Page < PolicySetDefinitionInner > call ( ServiceResponse < Page < PolicySetDefinitionInner > > response ) { r...
public class Measure { /** * setter for normalizedValue - sets * @ generated * @ param v value to set into the feature */ public void setNormalizedValue ( float v ) { } }
if ( Measure_Type . featOkTst && ( ( Measure_Type ) jcasType ) . casFeat_normalizedValue == null ) jcasType . jcas . throwFeatMissing ( "normalizedValue" , "ch.epfl.bbp.uima.types.Measure" ) ; jcasType . ll_cas . ll_setFloatValue ( addr , ( ( Measure_Type ) jcasType ) . casFeatCode_normalizedValue , v ) ;
public class ClientFactory { /** * 删除用户事件 * @ param pUserName */ protected void onRemoveClient ( String pUserName , String pId , String pAddress ) { } }
if ( null != mClientFactoryListener ) { mClientFactoryListener . removeClient ( this , new RemoveClientEvent ( pUserName , pId , pAddress ) ) ; }
public class ClassifierCombiner { /** * Some basic testing of the ClassifierCombiner . * @ param args Command - line arguments as properties : - loadClassifier1 serializedFile - loadClassifier2 serializedFile * @ throws Exception If IO or serialization error loading classifiers */ public static void main ( String [...
Properties props = StringUtils . argsToProperties ( args ) ; ClassifierCombiner ec = new ClassifierCombiner ( props ) ; System . err . println ( ec . classifyToString ( "Marketing : Sony Hopes to Win Much Bigger Market For Wide Range of Small-Video Products --- By Andrew B. Cohen Staff Reporter of The Wall Street Journ...
public class MPP8Reader { /** * Clear transient member data . */ private void clearMemberData ( ) { } }
m_reader = null ; m_root = null ; m_eventManager = null ; m_file = null ; m_calendarMap = null ; m_projectDir = null ; m_viewDir = null ;
public class TransformerFactoryImpl { /** * Create an XMLFilter that uses the given source as the * transformation instructions . * @ param src The source of the transformation instructions . * @ return An XMLFilter object , or null if this feature is not supported . * @ throws TransformerConfigurationException...
Templates templates = newTemplates ( src ) ; if ( templates == null ) return null ; return newXMLFilter ( templates ) ;
public class SortOrderTableHeaderCellRenderer { /** * Returns the sort priority of the specified column in the given * table , where 0 means the highest priority , and - 1 means that * the column is not sorted . * @ param table The table * @ param column The column * @ return The sort priority */ private stat...
List < ? extends SortKey > sortKeys = table . getRowSorter ( ) . getSortKeys ( ) ; for ( int i = 0 ; i < sortKeys . size ( ) ; i ++ ) { SortKey sortKey = sortKeys . get ( i ) ; if ( sortKey . getColumn ( ) == table . convertColumnIndexToModel ( column ) ) { return i ; } } return - 1 ;
public class UndefinedImpl { /** * returns the scope that contains a specific key * @ param key * @ return */ public Collection getScopeFor ( Collection . Key key , Scope defaultValue ) { } }
Object rtn = null ; if ( checkArguments ) { rtn = local . get ( key , NullSupportHelper . NULL ( ) ) ; if ( rtn != NullSupportHelper . NULL ( ) ) return local ; rtn = argument . getFunctionArgument ( key , NullSupportHelper . NULL ( ) ) ; if ( rtn != NullSupportHelper . NULL ( ) ) return argument ; } // get data from q...
public class InferenceSpecification { /** * A list of the instance types that are used to generate inferences in real - time . * @ param supportedRealtimeInferenceInstanceTypes * A list of the instance types that are used to generate inferences in real - time . * @ return Returns a reference to this object so tha...
java . util . ArrayList < String > supportedRealtimeInferenceInstanceTypesCopy = new java . util . ArrayList < String > ( supportedRealtimeInferenceInstanceTypes . length ) ; for ( ProductionVariantInstanceType value : supportedRealtimeInferenceInstanceTypes ) { supportedRealtimeInferenceInstanceTypesCopy . add ( value...
public class Directory { /** * Triggers the { @ link PathChangeListener # modified ( PathChangeEvent ) } on all listeners specified if the * file represented by the path specified has been changed i . e . has a new checksum . If no checksum change * has been detected , nothing happens . * @ param pFile File which...
if ( pDispatcher . hasListeners ( ) ) { if ( pIsCreated ) { informCreatedOrInitial ( pDispatcher , pNewRootOrNull , pFile ) ; } else { getResource ( pFile ) . update ( getTimeout ( ) , update -> { if ( update . hasChanged ( ) ) { LOG . debug ( "Processing {} because {} has been changed" , update , pFile ) ; inform ( pD...
public class MatchExptScript { /** * Clear datasets , blockers , or learners . */ public void clear ( String what ) { } }
if ( what . equals ( "blockers" ) ) blockers . clear ( ) ; else if ( what . equals ( "datasets" ) ) datasets . clear ( ) ; else if ( what . equals ( "learners" ) ) learners . clear ( ) ; else if ( what . equals ( "all" ) ) { clear ( "blockers" ) ; clear ( "datasets" ) ; clear ( "learners" ) ; } else { System . out . pr...
public class Script { /** * Gets the count of P2SH Sig Ops in the Script scriptSig */ public static long getP2SHSigOpCount ( byte [ ] scriptSig ) throws ScriptException { } }
Script script = new Script ( ) ; try { script . parse ( scriptSig ) ; } catch ( ScriptException e ) { // Ignore errors and count up to the parse - able length } for ( int i = script . chunks . size ( ) - 1 ; i >= 0 ; i -- ) if ( ! script . chunks . get ( i ) . isOpCode ( ) ) { Script subScript = new Script ( ) ; subScr...
public class GraphPath { /** * Remove the path ' s elements after the * specified one which is starting * at the specified point . The specified element will * be removed . * < p > This function removes after the < i > last occurence < / i > * of the given object . * @ param obj is the segment to remove *...
return removeAfter ( lastIndexOf ( obj , pt ) , true ) ;
public class FormatterMojo { /** * sha512hash . * @ param str * the str * @ return the string */ private String sha512hash ( String str ) { } }
return Hashing . sha512 ( ) . hashBytes ( str . getBytes ( getEncoding ( ) ) ) . toString ( ) ;
public class Swagger2MarkupProperties { /** * Return the MarkupLanguage property value associated with the given key , or * { @ code defaultValue } if the key cannot be resolved . * @ param key the property name to resolve * @ return The MarkupLanguage property */ public Optional < MarkupLanguage > getMarkupLangu...
Optional < String > property = getString ( key ) ; if ( property . isPresent ( ) ) { return Optional . of ( MarkupLanguage . valueOf ( property . get ( ) ) ) ; } else { return Optional . empty ( ) ; }
public class DBInstance { /** * Contains one or more identifiers of DB clusters that are Read Replicas of this DB instance . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setReadReplicaDBClusterIdentifiers ( java . util . Collection ) } or * { @ link # wi...
if ( this . readReplicaDBClusterIdentifiers == null ) { setReadReplicaDBClusterIdentifiers ( new java . util . ArrayList < String > ( readReplicaDBClusterIdentifiers . length ) ) ; } for ( String ele : readReplicaDBClusterIdentifiers ) { this . readReplicaDBClusterIdentifiers . add ( ele ) ; } return this ;
public class ApplicationWindowAwareCommand { /** * Returns the { @ link javax . swing . JFrame } of the application window that this command belongs to . * @ return The control component of the application window , never null . */ protected JFrame getParentWindowControl ( ) { } }
// allow subclasses to derive where the application window comes from final ApplicationWindow applicationWindow = getApplicationWindow ( ) ; if ( applicationWindow == null ) { return ValkyrieRepository . getInstance ( ) . getApplicationConfig ( ) . windowManager ( ) . getActiveWindow ( ) . getControl ( ) ; } return app...
public class StringUtil { /** * Takes a block of text which might have long lines in it and wraps * the long lines based on the supplied wrapColumn parameter . It was * initially implemented for use by VelocityEmail . If there are tabs * in inString , you are going to get results that are a bit strange , * sinc...
if ( inString == null ) { return null ; } final StringTokenizer lineTokenizer = new StringTokenizer ( inString , newline , true ) ; final StringBuilder builder = new StringBuilder ( ) ; while ( lineTokenizer . hasMoreTokens ( ) ) { try { String nextLine = lineTokenizer . nextToken ( ) ; if ( nextLine . length ( ) > wra...
public class TableRow { /** * Add a span across columns * @ param colIndex the index of the first column * @ param n the number of columns in the span */ public void setColumnsSpanned ( final int colIndex , final int n ) { } }
if ( n <= 1 ) return ; final TableCell firstCell = this . getOrCreateCell ( colIndex ) ; if ( firstCell . isCovered ( ) ) // already spanned return ; firstCell . markColumnsSpanned ( n ) ; this . coverRightCells ( colIndex , n ) ;
public class Bot { /** * Call this method to set the " Greeting Text " . A user sees this when it opens up the chat window for the * first time . You can specify different messages for different locales . Therefore , this method receives an * array of { @ code greeting } . * See https : / / developers . facebook ...
Event event = new Event ( ) . setGreeting ( greeting ) ; return restTemplate . postForEntity ( fbMessengerProfileUrl , event , Response . class ) ;
public class RebalanceUtils { /** * Confirms that any nodes from supersetCluster that are in subsetCluster * have the same state ( i . e . , node id , host name , and ports ) . Specific * partitions hosted are not compared . * @ param subsetCluster * @ param supersetCluster */ public static void validateCluster...
if ( ! supersetCluster . getNodeIds ( ) . containsAll ( subsetCluster . getNodeIds ( ) ) ) { throw new VoldemortException ( "Superset cluster does not contain all nodes from subset cluster[ subset cluster node ids (" + subsetCluster . getNodeIds ( ) + ") are not a subset of superset cluster node ids (" + supersetCluste...
import java . util . List ; import java . util . stream . Collectors ; class ListMultiplier { /** * This function applies a multiplier to each element in a list using the map function . * > > > list _ multiplier ( [ 1 , 2 , 3 , 4 , 5 , 6 , 7 ] , 3) * [ 3 , 6 , 9 , 12 , 15 , 18 , 21] * > > > list _ multiplier ( [ ...
return numbers . stream ( ) . map ( num -> num * multiplier ) . collect ( Collectors . toList ( ) ) ;
public class CleaneLingSolver { /** * Updates the glue value for a given clause . * @ param c the clause */ private void updateGlue ( final CLClause c ) { } }
if ( ! this . config . glueupdate ) { return ; } if ( ! this . config . gluered ) { assert c . glue ( ) == 0 ; return ; } assert this . frames . empty ( ) ; for ( int i = 0 ; i < c . lits ( ) . size ( ) ; i ++ ) { markFrame ( c . lits ( ) . get ( i ) ) ; } final int newGlue = unmarkFrames ( ) ; if ( newGlue >= c . glue...
public class KeyboardManager { /** * Called when Swing notifies us that a key has been pressed while the * keyboard manager is active . * @ return true to swallow the key event */ protected boolean keyPressed ( KeyEvent e ) { } }
logKey ( "keyPressed" , e ) ; // get the action command associated with this key int keyCode = e . getKeyCode ( ) ; boolean hasCommand = _xlate . hasCommand ( keyCode ) ; if ( hasCommand ) { // get the info object for this key , creating one if necessary KeyInfo info = _keys . get ( keyCode ) ; if ( info == null ) { in...
public class TextFileAuthentication { /** * Can be used to create entries in the users textfile * @ param args username and password */ public static void main ( String [ ] args ) { } }
if ( args . length < 2 ) { System . err . println ( "Two arguments needed as username and password" ) ; System . exit ( - 1 ) ; } User user = new User ( ) ; user . name = args [ 0 ] ; user . password . setPassword ( args [ 1 ] . toCharArray ( ) ) ; for ( int i = 2 ; i < args . length ; i ++ ) { user . roles . add ( new...
public class WTextField { /** * Set the value of the { @ code autocomplete } attribute for the current field . * @ param autocompleteValue the value to set as a ( optionally space delimited list of ) String value ( s ) . */ protected void setAutocomplete ( final String autocompleteValue ) { } }
final String newValue = Util . empty ( autocompleteValue ) ? null : autocompleteValue ; if ( ! Util . equals ( newValue , getAutocomplete ( ) ) ) { getOrCreateComponentModel ( ) . autocomplete = newValue ; }
public class UIClientWebSocket { /** * When a UI client connects , this method is called . This will immediately send a welcome * message to the UI client . * @ param session the new UI client ' s session */ @ OnOpen public void uiClientSessionOpen ( Session session ) { } }
log . infoWsSessionOpened ( session . getId ( ) , endpoint ) ; wsEndpoints . getUiClientSessions ( ) . addSession ( session . getId ( ) , session ) ; WelcomeResponse welcomeResponse = new WelcomeResponse ( ) ; // FIXME we should not send the true sessionIds to clients to prevent spoofing . welcomeResponse . setSessionI...
public class CmsLockManager { /** * Removes all locks of a user . < p > * Edition and system locks are removed . < p > * @ param userId the id of the user whose locks should be removed */ public void removeLocks ( CmsUUID userId ) { } }
Iterator < CmsLock > itLocks = OpenCms . getMemoryMonitor ( ) . getAllCachedLocks ( ) . iterator ( ) ; while ( itLocks . hasNext ( ) ) { CmsLock currentLock = itLocks . next ( ) ; boolean editLock = currentLock . getEditionLock ( ) . getUserId ( ) . equals ( userId ) ; boolean sysLock = currentLock . getSystemLock ( ) ...
public class GitlabAPI { /** * GET / projects / : id / repository / commits / : sha / diff */ public List < GitlabCommitDiff > getCommitDiffs ( Serializable projectId , String commitHash ) throws IOException { } }
return getCommitDiffs ( projectId , commitHash , new Pagination ( ) ) ;
public class DolphinPlatformApplication { /** * This method is called if the connection to the Dolphin Platform server throws an exception at runtime . This can * for example happen if the server is shut down while the client is still running or if the server responses with * an error code . * @ param primaryStag...
Assert . requireNonNull ( runtimeException , "runtimeException" ) ; LOG . error ( "Dolphin Platform runtime error in thread " + runtimeException . getThread ( ) . getName ( ) , runtimeException ) ; Platform . exit ( ) ;
public class SimpleNamingStrategy { /** * Turns the name into a valid , simplified Java Identifier . * @ param name input String * @ return java identifier , based on input String . */ private String toJavaName ( String name ) { } }
StringBuilder stb = new StringBuilder ( ) ; char [ ] namechars = name . toCharArray ( ) ; if ( ! Character . isJavaIdentifierStart ( namechars [ 0 ] ) ) { stb . append ( "__" ) ; } else { stb . append ( namechars [ 0 ] ) ; } for ( int i = 1 ; i < namechars . length ; i ++ ) { if ( ! Character . isJavaIdentifierPart ( n...
public class TopLevelGedDocumentMongoToGedObjectVisitor { /** * { @ inheritDoc } */ @ Override public final void visit ( final SourceDocumentMongo document ) { } }
gedObject = new Source ( parent , new ObjectId ( document . getString ( ) ) ) ;
public class PrivateZonesInner { /** * Updates a Private DNS zone . Does not modify virtual network links or DNS records within the zone . * @ param resourceGroupName The name of the resource group . * @ param privateZoneName The name of the Private DNS zone ( without a terminating dot ) . * @ param parameters Pa...
return updateWithServiceResponseAsync ( resourceGroupName , privateZoneName , parameters , ifMatch ) . toBlocking ( ) . last ( ) . body ( ) ;
public class Task { /** * Executes the task in the given { @ link ComThread } * @ param t the ComThread to execute the task * @ return the return value of the Task execution ( returned by { @ link # call ( ) } ) . */ public final T execute ( ComThread t ) { } }
if ( Thread . currentThread ( ) == t ) // if invoked from within ComThread , execute it at once return call ( ) ; else // otherwise schedule the execution and block return t . execute ( this ) ;
public class GrassLegacyUtilities { /** * Returns the list of files involved in the raster map issues . If for example a map has to be * deleted , then all these files have to . * @ param mapsetPath - the path of the mapset * @ param mapname - the name of the map * @ return the array of strings containing the f...
File file = null ; File file2 = null ; file = new File ( mapsetPath + File . separator + GrassLegacyConstans . FCELL + File . separator + mapname ) ; file2 = new File ( mapsetPath + File . separator + GrassLegacyConstans . CELL + File . separator + mapname ) ; // the map is in one of the two if ( ! file . exists ( ) &&...
public class FieldsAndGetters { /** * Dumps all fields and getters of { @ code obj } to { @ code printer } . * @ see # dumpIf */ public static void dumpAll ( String name , Object obj , StringPrinter printer ) { } }
dumpIf ( name , obj , Predicates . alwaysTrue ( ) , Predicates . alwaysTrue ( ) , printer ) ;
public class WorkSheet { /** * * Combine two work sheets where you join based on rows . Rows that are * found in one but not the other are removed . If the second sheet is meta * data then a meta data column will be added between the two joined columns * @ param w1 * @ param w2 * @ param secondSheetMetaData ...
ArrayList < String > w1Columns = w1 . getColumns ( ) ; ArrayList < String > w2Columns = w2 . getColumns ( ) ; ArrayList < String > w1DataColumns = w1 . getDataColumns ( ) ; ArrayList < String > w2DataColumns = w2 . getDataColumns ( ) ; ArrayList < String > w1MetaDataColumns = w1 . getMetaDataColumns ( ) ; ArrayList < S...
public class ButterKnifeProcessor { /** * Returns the first duplicate element inside an array , null if there are no duplicates . */ private static @ Nullable Integer findDuplicate ( int [ ] array ) { } }
Set < Integer > seenElements = new LinkedHashSet < > ( ) ; for ( int element : array ) { if ( ! seenElements . add ( element ) ) { return element ; } } return null ;
public class CPSpecificationOptionPersistenceImpl { /** * Returns the cp specification option where groupId = & # 63 ; and key = & # 63 ; or throws a { @ link NoSuchCPSpecificationOptionException } if it could not be found . * @ param groupId the group ID * @ param key the key * @ return the matching cp specifica...
CPSpecificationOption cpSpecificationOption = fetchByG_K ( groupId , key ) ; if ( cpSpecificationOption == null ) { StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "groupId=" ) ; msg . append ( groupId ) ; msg . append ( ", key=" ) ; msg . append ( key ) ; msg . ...
public class UriEscape { /** * Perform am URI query parameter ( name or value ) < strong > unescape < / strong > operation * on a < tt > Reader < / tt > input , writing results to a < tt > Writer < / tt > . * This method will unescape every percent - encoded ( < tt > % HH < / tt > ) sequences present in input , *...
if ( writer == null ) { throw new IllegalArgumentException ( "Argument 'writer' cannot be null" ) ; } if ( encoding == null ) { throw new IllegalArgumentException ( "Argument 'encoding' cannot be null" ) ; } UriEscapeUtil . unescape ( reader , writer , UriEscapeUtil . UriEscapeType . QUERY_PARAM , encoding ) ;
public class RequestBaratineImpl { /** * Starts an upgrade of the HTTP request to a protocol on raw TCP . */ @ Override public void upgrade ( Object protocol ) { } }
Objects . requireNonNull ( protocol ) ; if ( protocol instanceof ServiceWebSocket ) { ServiceWebSocket < ? , ? > webSocket = ( ServiceWebSocket < ? , ? > ) protocol ; upgradeWebSocket ( webSocket ) ; } else { throw new IllegalArgumentException ( protocol . toString ( ) ) ; }
public class WaitFor { /** * Waits up to the provided wait time for a prompt present on the page has content equal to the * expected text . This information will be logged and recorded , with a * screenshot for traceability and added debugging support . * @ param expectedPromptText the expected text of the prompt...
try { double timeTook = popup ( seconds ) ; timeTook = popupEquals ( seconds - timeTook , expectedPromptText ) ; checkPromptEquals ( expectedPromptText , seconds , timeTook ) ; } catch ( TimeoutException e ) { checkPromptEquals ( expectedPromptText , seconds , seconds ) ; }
public class BinaryNumberIncrementor { /** * Process specified entry and return the result . * @ param entry entry to process * @ return processing result */ public Object process ( BinaryEntry entry ) { } }
Binary binValue = entry . getBinaryValue ( ) ; if ( binValue == null ) { return binValue ; } PofValue pofValue = getPofValue ( binValue ) ; Number oldValue = ( Number ) get ( pofValue ) ; if ( oldValue == null ) { oldValue = Numbers . getDefaultValue ( numInc . getClass ( ) ) ; } Number newValue = Numbers . add ( oldVa...
public class AAFAuthorizer { /** * Check remoted AAF Permissions * @ param aau * @ param type * @ param instance * @ return */ private Set < Permission > checkPermissions ( AAFAuthenticatedUser aau , String type , String instance ) { } }
// Can perform ALL actions String fullName = aau . getFullName ( ) ; PermHolder ph = new PermHolder ( aau ) ; aafLur . fishOneOf ( fullName , ph , type , instance , actions ) ; return ph . permissions ;
public class ServiceLoaderHelper { /** * Uses the { @ link ServiceLoader } to load all SPI implementations of the * passed class and return only the first instance . * @ param < T > * The implementation type to be loaded * @ param aSPIClass * The SPI interface class . May not be < code > null < / code > . *...
return getFirstSPIImplementation ( aSPIClass , aClassLoader , null ) ;
public class LogLogisticDistribution { /** * Cumulative density function . * @ param val Value * @ param shape Shape * @ param location Location * @ param scale Scale * @ return CDF */ public static double cdf ( double val , double shape , double location , double scale ) { } }
if ( val < location ) { return 0 ; } val = ( val - location ) / scale ; return 1. / ( 1. + FastMath . pow ( val , - shape ) ) ;
public class CassandraSpanStore { /** * This fans out into a number of requests corresponding to query input . In simplest case , there * is less than a day of data queried , and only one expression . This implies one call to fetch * trace IDs and another to retrieve the span details . * < p > The amount of backe...
if ( ! searchEnabled ) return Call . emptyList ( ) ; TimestampRange timestampRange = timestampRange ( request ) ; // If we have to make multiple queries , over fetch on indexes as they don ' t return distinct // ( trace id , timestamp ) rows . This mitigates intersection resulting in < limit traces final int traceIndex...
public class LinkedOptionalMap { /** * Assuming all the entries of this map are present ( keys and values ) this method would return * a map with these key and values , stripped from their Optional wrappers . * NOTE : please note that if any of the key or values are absent this method would throw an { @ link Illega...
final LinkedHashMap < K , V > unwrapped = new LinkedHashMap < > ( underlyingMap . size ( ) ) ; for ( Entry < String , KeyValue < K , V > > entry : underlyingMap . entrySet ( ) ) { String namedKey = entry . getKey ( ) ; KeyValue < K , V > kv = entry . getValue ( ) ; if ( kv . key == null ) { throw new IllegalStateExcept...
public class WSMessage { /** * Adds additional payload data . * @ param additionalPayload */ public void addPayload ( IoBuffer additionalPayload ) { } }
if ( payload == null ) { payload = IoBuffer . allocate ( additionalPayload . remaining ( ) ) ; payload . setAutoExpand ( true ) ; } this . payload . put ( additionalPayload ) ;
public class Interface { /** * Use this API to reset Interface . */ public static base_response reset ( nitro_service client , Interface resource ) throws Exception { } }
Interface resetresource = new Interface ( ) ; resetresource . id = resource . id ; return resetresource . perform_operation ( client , "reset" ) ;
public class ISPNCacheWorkspaceStorageCache { /** * { @ inheritDoc } */ public void put ( ItemData item ) { } }
// There is different commit processing for NullNodeData and ordinary ItemData . if ( item instanceof NullItemData ) { putNullItem ( ( NullItemData ) item ) ; return ; } boolean inTransaction = cache . isTransactionActive ( ) ; try { if ( ! inTransaction ) { cache . beginTransaction ( ) ; } cache . setLocal ( true ) ; ...
public class CmsChangedResourceCollector { /** * Returns a List of all changed resources in the folder pointed to by the parameter * sorted by the date attributes specified in the parameter . < p > * @ param cms the current CmsObject * @ param param must contain an extended collector parameter set as described by...
Map < String , String > params = getParameters ( param ) ; String foldername = "/" ; if ( params . containsKey ( PARAM_KEY_RESOURCE ) ) { foldername = CmsResource . getFolderPath ( params . get ( PARAM_KEY_RESOURCE ) ) ; } long dateFrom = 0L ; long dateTo = Long . MAX_VALUE ; if ( params . containsKey ( PARAM_KEY_DATEF...
public class Connector { /** * This method will try to make a simple tcp connection to the asterisk * manager to establish it is up . We do this as the default makeConnection * doesn ' t have a timeout and will sit trying to connect for a minute or so . * By using method when the user realises they have a problem...
try ( Socket socket = new Socket ( ) ) { socket . setSoTimeout ( 2000 ) ; InetSocketAddress asteriskHost = new InetSocketAddress ( asteriskSettings . getAsteriskIP ( ) , asteriskSettings . getManagerPortNo ( ) ) ; socket . connect ( asteriskHost , 2000 ) ; }
public class ExtensionList { /** * Loads all the extensions . */ protected List < ExtensionComponent < T > > load ( ) { } }
LOGGER . fine ( ( ) -> String . format ( "Loading ExtensionList '%s'" , extensionType . getName ( ) ) ) ; if ( LOGGER . isLoggable ( Level . FINER ) ) { LOGGER . log ( Level . FINER , String . format ( "Loading ExtensionList '%s' from" , extensionType . getName ( ) ) , new Throwable ( "Only present for stacktrace infor...
public class FormInterceptor { /** * Override paint in order to perform processing specific to this interceptor . * @ param renderContext the renderContext to send the output to . */ @ Override public void paint ( final RenderContext renderContext ) { } }
getBackingComponent ( ) . paint ( renderContext ) ; // We don ' t want to remember the focus for the next render because on // a multi portlet page , we ' d end up with multiple portlets trying to // set the focus . UIContext uic = UIContextHolder . getCurrent ( ) ; if ( uic . isFocusRequired ( ) ) { boolean sticky = C...