signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class JqmClientFactory { /** * Return a new client that may be cached or not . Given properties are always use when not cached , and only used at creation time for * cached clients . * @ param name * if null , default client . Otherwise , helpful to retrieve cached clients later . * @ param p * a set o...
Properties p2 = null ; if ( binder == null ) { bind ( ) ; } if ( p == null ) { p2 = props ; } else { p2 = new Properties ( props ) ; p2 . putAll ( p ) ; } return binder . getClientFactory ( ) . getClient ( name , p2 , cached ) ;
public class JsApiMessageImpl { /** * Helper method used by the main Message Property methods to obtain any * JMS _ IBM _ MQMD _ Properties explicitly set , in the form of a map . * The method has package level visibility as it is used by JsJmsMessageImpl * and JsSdoMessageimpl . * @ return A JsMsgMap containin...
if ( mqMdSetPropertiesMap == null ) { // There will not usually be any set MQMD properties , so the JMF choice defaults to // to empty ( and will definitely be empty if the message has arrived from a // pre - v7 WAS ) . This is different from the other maps which default to empty lists . if ( getHdr2 ( ) . getChoiceFie...
public class SynchronizeFXTomcatChannel { /** * Informs this { @ link CommandTransferServer } that a client received a command . * @ param message The message containing the received command . * @ param sender The connection that received the message . */ void recivedMessage ( final ByteBuffer message , final Synch...
if ( LOG . isTraceEnabled ( ) ) { LOG . trace ( "Received a message in thread: id: " + Thread . currentThread ( ) . getName ( ) + ", name: " + Thread . currentThread ( ) . getName ( ) ) ; } List < Command > commands ; try { commands = serializer . deserialize ( message . array ( ) ) ; } catch ( final SynchronizeFXExcep...
public class TTFFile { /** * Dumps a few informational values to System . out . */ public void printStuff ( ) { } }
System . out . println ( "Font name: " + fontName ) ; System . out . println ( "Full name: " + fullName ) ; System . out . println ( "Family name: " + familyName ) ; System . out . println ( "Subfamily name: " + subFamilyName ) ; System . out . println ( "Notice: " + notice ) ; System . out . println ( "xHeigh...
public class ContentValues { /** * Gets a value and converts it to a Byte . * @ param key the value to get * @ return the Byte value , or null if the value is missing or cannot be converted */ public Byte getAsByte ( String key ) { } }
Object value = mValues . get ( key ) ; try { return value != null ? ( ( Number ) value ) . byteValue ( ) : null ; } catch ( ClassCastException e ) { if ( value instanceof CharSequence ) { try { return Byte . valueOf ( value . toString ( ) ) ; } catch ( NumberFormatException e2 ) { DLog . e ( TAG , "Cannot parse Byte va...
public class CmsModulesEditBase { /** * Creates all module folders that are selected in the input form . < p > * @ param module the module * @ return the updated module * @ throws CmsException if somehting goes wrong */ private CmsModule createModuleFolders ( CmsModule module ) throws CmsException { } }
String modulePath = CmsWorkplace . VFS_PATH_MODULES + module . getName ( ) + "/" ; List < CmsExportPoint > exportPoints = module . getExportPoints ( ) ; List < String > resources = module . getResources ( ) ; // set the createModuleFolder flag if any other flag is set if ( module . isCreateClassesFolder ( ) || module ....
public class RandomText { /** * Generates a random phone number . * The phone number has the format : ( XXX ) XXX - YYYY * @ return a random phone number . */ public static String phone ( ) { } }
StringBuilder result = new StringBuilder ( ) ; result . append ( "(" ) . append ( RandomInteger . nextInteger ( 111 , 999 ) ) . append ( ") " ) . append ( RandomInteger . nextInteger ( 111 , 999 ) ) . append ( "-" ) . append ( RandomInteger . nextInteger ( 0 , 9999 ) ) ; return result . toString ( ) ;
public class NaetherImpl { /** * / * ( non - Javadoc ) * @ see com . tobedevoured . naether . api . Naether # addDependency ( org . sonatype . aether . graph . Dependency ) */ public void addDependency ( Dependency dependency ) { } }
Dependency newDep = null ; String classifier = dependency . getArtifact ( ) . getClassifier ( ) ; if ( Const . TEST . equals ( classifier ) || Const . TEST_JAR . equals ( classifier ) ) { ArtifactType artifactType = new DefaultArtifactType ( Const . TEST_JAR , Const . JAR , Const . TEST_JAR , null ) ; Artifact artifact...
public class JmsJcaManagedConnectionFactoryImpl { /** * Creates a JMS connection factory . This connection factory is given a * < code > JmsJcaConnectionFactory < / code > which , in turn , is associated with * this managed connection factory and uses the given connection manager . * @ param connectionManager *...
if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , "createConnectionFactory" , connectionManager ) ; } final JmsJcaConnectionFactoryImpl connectionFactory = new JmsJcaConnectionFactoryImpl ( this , connectionManager ) ; final JmsRAFactoryFactory jmsRAFactory =...
public class StunAttributeFactory { /** * Create a LifetimeAttribute . * @ param lifetime * lifetime value * @ return newly created LifetimeAttribute */ public static LifetimeAttribute createLifetimeAttribute ( int lifetime ) { } }
LifetimeAttribute attribute = new LifetimeAttribute ( ) ; attribute . setLifetime ( lifetime ) ; return attribute ;
public class StructureTools { /** * Returns and array of all non - Hydrogen atoms in the given Chain , * optionally including HET atoms or not Waters are not included . * @ param c * @ param hetAtoms * if true HET atoms are included in array , if false they are not * @ return */ public static final Atom [ ] g...
List < Atom > atoms = new ArrayList < Atom > ( ) ; for ( Group g : c . getAtomGroups ( ) ) { if ( g . isWater ( ) ) continue ; for ( Atom a : g . getAtoms ( ) ) { if ( a . getElement ( ) == Element . H ) continue ; if ( ! hetAtoms && g . getType ( ) . equals ( GroupType . HETATM ) ) continue ; atoms . add ( a ) ; } } r...
public class ParaClient { /** * Returns a { @ link com . erudika . para . core . User } or an * { @ link com . erudika . para . core . App } that is currently authenticated . * @ param < P > an App or User * @ return a { @ link com . erudika . para . core . User } or an { @ link com . erudika . para . core . App ...
Map < String , Object > data = getEntity ( invokeGet ( "_me" , null ) , Map . class ) ; return ParaObjectUtils . setAnnotatedFields ( data ) ;
public class CrdtSetDelegate { /** * Updates the set elements . * @ param elements the elements to update */ private void updateElements ( Map < String , SetElement > elements ) { } }
for ( SetElement element : elements . values ( ) ) { if ( element . isTombstone ( ) ) { if ( remove ( element ) ) { eventListeners . forEach ( listener -> listener . event ( new SetDelegateEvent < > ( SetDelegateEvent . Type . REMOVE , decode ( element . value ( ) ) ) ) ) ; } } else { if ( add ( element ) ) { eventList...
public class SingleExecutionTime { /** * Provide feedback if a given date matches the cron expression . * @ param date - ZonedDateTime instance . If null , a NullPointerException will be raised . * @ return true if date matches cron expression requirements , false otherwise . */ public boolean isMatch ( ZonedDateTi...
// Issue # 200 : Truncating the date to the least granular precision supported by different cron systems . // For Quartz , it ' s seconds while for Unix & Cron4J it ' s minutes . final boolean isSecondGranularity = cronDefinition . containsFieldDefinition ( SECOND ) ; if ( isSecondGranularity ) { date = date . truncate...
public class LocalisationManager { /** * Method getXmitQueueIterator * < p > Return a cloned iterator over the transmit queue points * for this link . * @ return Iterator */ public Iterator < PtoPMessageItemStream > getXmitQueueIterator ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getXmitQueueIterator" ) ; Iterator < PtoPMessageItemStream > itr = null ; synchronized ( _xmitQueuePoints ) { itr = ( ( HashMap ) _xmitQueuePoints . clone ( ) ) . values ( ) . iterator ( ) ; } if ( TraceComponent . isAnyTra...
public class CSL { /** * Gets or initializes the shared script runner { @ link # sharedRunner } * @ return the runner * @ throws IOException if bundles scripts could not be loaded */ private static ScriptRunner getRunner ( ) throws IOException { } }
if ( sharedRunner . get ( ) == null ) { // create JavaScript runner ScriptRunner runner = ScriptRunnerFactory . createRunner ( ) ; // load bundled scripts try { runner . loadScript ( CSL . class . getResource ( "dump.js" ) ) ; runner . loadScript ( CSL . class . getResource ( "citeproc.js" ) ) ; runner . loadScript ( C...
public class SpatialAnchorsAccountsInner { /** * Updating a Spatial Anchors Account . * @ param resourceGroupName Name of an Azure resource group . * @ param spatialAnchorsAccountName Name of an Mixed Reality Spatial Anchors Account . * @ param spatialAnchorsAccount Spatial Anchors Account parameter . * @ throw...
return updateWithServiceResponseAsync ( resourceGroupName , spatialAnchorsAccountName , spatialAnchorsAccount ) . toBlocking ( ) . single ( ) . body ( ) ;
public class CmsPreviewUtil { /** * Returns the available image format names for gallery widget mode . < p > * @ return the available image format names */ public static String [ ] getFormatNames ( ) { } }
JsArrayString formatNames = nativeGetFormatNames ( ) ; if ( ( formatNames == null ) || ( formatNames . length ( ) == 0 ) ) { return null ; } String [ ] result = new String [ formatNames . length ( ) ] ; for ( int i = 0 ; i < formatNames . length ( ) ; i ++ ) { result [ i ] = formatNames . get ( i ) ; } return result ;
public class ContextFilterFactory { /** * Modify the configuration to set the { @ link ContextFilter } class . * @ param config Input { @ link Config } . * @ param klazz Class of desired { @ link ContextFilter } . * @ return Modified { @ link Config } . */ public static Config setContextFilterClass ( Config confi...
return config . withValue ( CONTEXT_FILTER_CLASS , ConfigValueFactory . fromAnyRef ( klazz . getCanonicalName ( ) ) ) ;
public class SystemUtil { /** * returns a system setting by either a Java property name or a System environment variable * @ param name - either a lowercased Java property name ( e . g . lucee . controller . disabled ) or an * UPPERCASED Environment variable name ( ( e . g . LUCEE _ CONTROLLER _ DISABLED ) ) * @ ...
// env String value = System . getenv ( name ) ; if ( ! StringUtil . isEmpty ( value ) ) return value ; // prop value = System . getProperty ( name ) ; if ( ! StringUtil . isEmpty ( value ) ) return value ; // env 2 name = convertSystemPropToEnvVar ( name ) ; value = System . getenv ( name ) ; if ( ! StringUtil . isEmp...
public class ImageIngester { /** * If { @ link # ingest ( ) } was successful , returns a String with the * MIME type of the format . * @ return MIME type , e . g . < code > image / jpeg < / code > */ public MimeType getMimeType ( ) { } }
if ( format >= 0 && format < MIME_TYPE_STRINGS . length ) { if ( format == FORMAT_JPEG && progressive ) { return new MimeType ( "image/pjpeg" ) ; } return new MimeType ( MIME_TYPE_STRINGS [ format ] ) ; } else { return null ; }
public class ConditionalProbabilityTable { /** * Creates a CPT using only a subset of the features specified by < tt > categoriesToUse < / tt > . * @ param dataSet the data set to train from * @ param categoriesToUse the attributes to use in training . Each value corresponds to the categorical * index in < tt > d...
if ( categoriesToUse . size ( ) > dataSet . getNumFeatures ( ) + 1 ) throw new FailedToFitException ( "CPT can not train on a number of features greater then the dataset's feature count. " + "Specified " + categoriesToUse . size ( ) + " but data set has only " + dataSet . getNumFeatures ( ) ) ; CategoricalData [ ] tmp ...
public class MessageProcessor { /** * Get the Source Batch Handler */ public BatchHandler getSourceBatchHandler ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getSourceBatchHandler" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getSourceBatchHandler" , _sourceBatchHandler ) ; return _sourceBatchHandler ;
public class DefaultNodeManager { /** * Deploys a module */ private void doDeployModule ( final Message < JsonObject > message ) { } }
String moduleName = message . body ( ) . getString ( "module" ) ; if ( moduleName == null ) { message . reply ( new JsonObject ( ) . putString ( "status" , "error" ) . putString ( "message" , "No module name specified." ) ) ; return ; } JsonObject config = message . body ( ) . getObject ( "config" ) ; if ( config == nu...
public class CoronaJobHistory { /** * Log finish time of task . * @ param taskId task id * @ param taskType MAP or REDUCE * @ param finishTime finish timeof task in ms */ public void logTaskFinished ( TaskID taskId , String taskType , long finishTime , Counters counters ) { } }
if ( disableHistory ) { return ; } JobID id = taskId . getJobID ( ) ; if ( ! this . jobId . equals ( id ) ) { throw new RuntimeException ( "JobId from task: " + id + " does not match expected: " + jobId ) ; } if ( null != writers ) { log ( writers , RecordTypes . Task , new Keys [ ] { Keys . TASKID , Keys . TASK_TYPE ,...
public class ProposalLineItem { /** * Gets the programmaticCreativeSource value for this ProposalLineItem . * @ return programmaticCreativeSource * Indicates the { @ link ProgrammaticCreativeSource } of the programmatic * line item . * < span class = " constraint Applicable " > This attribute * is applicable wh...
return programmaticCreativeSource ;
public class nsacl6 { /** * Use this API to update nsacl6. */ public static base_response update ( nitro_service client , nsacl6 resource ) throws Exception { } }
nsacl6 updateresource = new nsacl6 ( ) ; updateresource . acl6name = resource . acl6name ; updateresource . aclaction = resource . aclaction ; updateresource . srcipv6 = resource . srcipv6 ; updateresource . srcipop = resource . srcipop ; updateresource . srcipv6val = resource . srcipv6val ; updateresource . srcport = ...
public class UReport { /** * Retrieve the raw statistics this Report would deliver , sorted in the * order specified ( or the order they were added to the benchmark , if null ) . * @ param comparator * The comparator to sort the results by . * @ return the statistics in the specified order . */ public List < US...
List < UStats > result = new ArrayList < > ( stats ) ; if ( comparator != null ) { result . sort ( comparator ) ; } return result ;
public class TZDBTimeZoneNames { /** * / * ( non - Javadoc ) * @ see android . icu . text . TimeZoneNames # getMetaZoneID ( java . lang . String , long ) */ @ Override public String getMetaZoneID ( String tzID , long date ) { } }
return TimeZoneNamesImpl . _getMetaZoneID ( tzID , date ) ;
public class CqlDataReaderDAO { /** * Converts the rows from the provided iterator into raw metadata . */ private Iterator < RecordEntryRawMetadata > rawMetadataFromCql ( final Iterator < Row > iter ) { } }
return Iterators . transform ( iter , row -> new RecordEntryRawMetadata ( ) . withTimestamp ( TimeUUIDs . getTimeMillis ( getChangeId ( row ) ) ) . withSize ( getValue ( row ) . remaining ( ) ) ) ;
public class Sniffy { /** * Execute the { @ link Callable # call ( ) } method , record the SQL queries * and return the { @ link Spy . SpyWithValue } object with stats * @ param callable code to test * @ param < V > type of return value * @ return statistics on executed queries * @ throws Exception if underly...
return spy ( ) . call ( callable ) ;
public class Mtrie { /** * actually removed rather than de - duplicated . */ public boolean rm ( Msg msg , Pipe pipe ) { } }
assert ( msg != null ) ; assert ( pipe != null ) ; return rmHelper ( msg , 1 , msg . size ( ) - 1 , pipe ) ;
public class IonReaderTextRawTokensX { /** * can unread it */ private final int load_exponent ( StringBuilder sb ) throws IOException { } }
int c = read_char ( ) ; if ( c == '-' || c == '+' ) { sb . append ( ( char ) c ) ; c = read_char ( ) ; } c = load_digits ( sb , c ) ; if ( c == '.' ) { sb . append ( ( char ) c ) ; c = read_char ( ) ; c = load_digits ( sb , c ) ; } return c ;
public class MatrixExtensions { /** * Replies the division of this matrix by the given scalar : { @ code left / right } . * < p > This function is an implementation of the operator for * the languages that defined or based on the * < a href = " https : / / www . eclipse . org / Xtext / " > Xtext framework < / a >...
assert right != null : AssertMessages . notNullParameter ( 1 ) ; final M result = ( M ) right . clone ( ) ; result . set ( left / right . getM00 ( ) , left / right . getM01 ( ) , left / right . getM02 ( ) , left / right . getM03 ( ) , left / right . getM10 ( ) , left / right . getM11 ( ) , left / right . getM12 ( ) , l...
public class RestoreManagerImpl { /** * ( non - Javadoc ) * @ see * org . duracloud . snapshot . service . restore . RestoreManager # transitionRestoreStatus * ( java . lang . Long , org . duracloud . snapshot . dto . RestoreStatus , * java . lang . String ) */ @ Override @ Transactional public Restoration tran...
Restoration restoration = getRestoration ( restorationId ) ; return _transitionRestoreStatus ( status , message , restoration ) ;
public class DateFormatHelper { /** * 根据字符串构造实例 。 * @ param date * 日期字符串 。 * @ param format * 格式 , 形式见 { @ code org . joda . time . format . DateTimeFormat } 。 * @ return 日期 */ public static Calendar parse ( final String date , final String format ) { } }
return parse ( date , DateTimeFormat . forPattern ( format ) ) ;
public class MapUtils { /** * Extract a value from a map . * @ param map * @ param key * @ param clazz * @ return */ public static < T > T getValue ( Map < String , Object > map , String key , Class < T > clazz ) { } }
return map != null ? ValueUtils . convertValue ( map . get ( key ) , clazz ) : null ;
public class ConfigurationUtils { /** * Finds the icon associated with an application template . * @ param name the application or template name * @ param qualifier the template qualifier or < code > null < / code > for an application * @ param configurationDirectory the DM ' s configuration directory * @ retur...
// Deal with an invalid directory if ( configurationDirectory == null ) return null ; // Find the root directory File root ; if ( ! Utils . isEmptyOrWhitespaces ( qualifier ) ) { ApplicationTemplate tpl = new ApplicationTemplate ( name ) . version ( qualifier ) ; root = ConfigurationUtils . findTemplateDirectory ( tpl ...
public class RestReportingEngine { /** * { @ inheritDoc } */ @ Override @ GET @ Path ( "/attacks/count-by-user" ) public int countAttacksByUser ( @ QueryParam ( "earliest" ) String earliest , @ QueryParam ( "username" ) String username ) throws NotAuthorizedException { } }
accessControlUtils . checkAuthorization ( Action . EXECUTE_REPORT , requestContext ) ; SearchCriteria criteria = new SearchCriteria ( ) . setEarliest ( earliest ) . setUser ( new User ( username ) ) ; return appSensorServer . getAttackStore ( ) . findAttacks ( criteria ) . size ( ) ;
public class SeleniumInterpreter { /** * { @ inheritDoc } */ @ Override public void interpret ( Specification specification ) { } }
SeleniumServer seleniumServer = null ; try { seleniumServer = new SeleniumServer ( getRemoteControlConfiguration ( ) ) ; seleniumServer . start ( ) ; startCommandProcessor ( ) ; super . interpret ( specification ) ; } catch ( Exception e ) { throw ExceptionImposter . imposterize ( e ) ; } finally { stopCommandProcessor...
public class AbstractValidateableDialogPreference { /** * Obtains , whether the value of the view should be validated , when the view loses its focus , or * not , from a specific typed array . * @ param typedArray * The typed array , it should be obtained from , whether the value of the view should be * validat...
boolean defaultValue = getContext ( ) . getResources ( ) . getBoolean ( R . bool . validateable_dialog_preference_default_validate_on_focus_lost ) ; validateOnFocusLost ( typedArray . getBoolean ( R . styleable . AbstractValidateableView_validateOnFocusLost , defaultValue ) ) ;
public class AnimatablePathValueParser { /** * Returns either an { @ link AnimatablePathValue } or an { @ link AnimatableSplitDimensionPathValue } . */ static AnimatableValue < PointF , PointF > parseSplitPath ( JsonReader reader , LottieComposition composition ) throws IOException { } }
AnimatablePathValue pathAnimation = null ; AnimatableFloatValue xAnimation = null ; AnimatableFloatValue yAnimation = null ; boolean hasExpressions = false ; reader . beginObject ( ) ; while ( reader . peek ( ) != JsonToken . END_OBJECT ) { switch ( reader . nextName ( ) ) { case "k" : pathAnimation = AnimatablePathVal...
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link PointPropertyType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link PointPropertyType } { @ code >...
return new JAXBElement < PointPropertyType > ( _PointMember_QNAME , PointPropertyType . class , null , value ) ;
public class LifecycleApproveChaincodeDefinitionForMyOrgRequest { /** * The chaincode validation parameter . Only this or chaincode endorsement policy { @ link # setChaincodeEndorsementPolicy ( LifecycleChaincodeEndorsementPolicy ) } may be set at any one time . * @ param validationParameter * @ throws InvalidArgum...
if ( null == validationParameter ) { throw new InvalidArgumentException ( "The valdiationParameter parameter can not be null." ) ; } this . validationParameter = ByteString . copyFrom ( validationParameter ) ;
public class Validate { /** * Method without varargs to increase performance */ public static < T extends CharSequence > T notBlank ( final T chars , final String message ) { } }
return INSTANCE . notBlank ( chars , message ) ;
public class DocumentReadTransform { /** * clean up by deleting the read document and the example transform */ public static void tearDownExample ( String host , int port , String user , String password , Authentication authType ) throws ResourceNotFoundException , ForbiddenUserException , FailedRequestException { } }
DatabaseClient client = DatabaseClientFactory . newClient ( host , port , user , password , authType ) ; XMLDocumentManager docMgr = client . newXMLDocumentManager ( ) ; docMgr . delete ( "/example/flipper.xml" ) ; TransformExtensionsManager transMgr = client . newServerConfigManager ( ) . newTransformExtensionsManager...
public class LazyResponseWrapper { /** * 代理getOutputStream , 真正write的时候才获取 */ public ServletOutputStream getOutputStream ( ) throws IOException { } }
return new ServletOutputStream ( ) { protected OutputStream proxy ; public void write ( int b ) throws IOException { if ( proxy == null ) proxy = getResponse ( ) . getOutputStream ( ) ; proxy . write ( b ) ; } public void write ( byte [ ] paramArrayOfByte , int off , int len ) throws IOException { if ( proxy == null ) ...
public class CmsSqlBooleanClause { /** * Creates a boolean " OR " expression . < p > * @ param fragments the operands of the " OR " * @ return the combined expressiong */ public static CmsSqlBooleanClause makeOr ( I_CmsQueryFragment ... fragments ) { } }
CmsSqlBooleanClause result = new CmsSqlBooleanClause ( "OR" ) ; for ( I_CmsQueryFragment fragment : fragments ) { result . addCondition ( fragment ) ; } return result ;
public class GetStagesResult { /** * The elements from this collection . * @ param items * The elements from this collection . */ public void setItems ( java . util . Collection < Stage > items ) { } }
if ( items == null ) { this . items = null ; return ; } this . items = new java . util . ArrayList < Stage > ( items ) ;
public class ServiceManagerSparql { /** * Obtains the list of operation URIs for a given Operation * @ param serviceUri the service URI * @ return a List of URIs with the operations provided by the service . If there are no operations , the List should be empty NOT null . */ @ Override public Set < URI > listOperat...
if ( serviceUri == null || ! serviceUri . isAbsolute ( ) ) { log . warn ( "The Service URI is either absent or relative. Provide an absolute URI" ) ; return ImmutableSet . of ( ) ; } URI graphUri ; try { graphUri = getGraphUriForElement ( serviceUri ) ; } catch ( URISyntaxException e ) { log . warn ( "The namespace of ...
public class BusItineraryHalt { /** * Replies the position of the bus halt on the road . * The replied position may differ from the * position of the associated bus stop because the * position on the road is a projection of the stop ' s position * on the road . * @ return the 2D position or < code > null < / ...
final Point1d p1d5 = getPosition1D ( ) ; if ( p1d5 != null ) { final Point2d pos = new Point2d ( ) ; p1d5 . getSegment ( ) . projectsOnPlane ( p1d5 . getCurvilineCoordinate ( ) , p1d5 . getLateralDistance ( ) , pos , null ) ; return pos ; } return null ;
public class CountrySpinnerAdapter { /** * Drop down item view * @ param position position of item * @ param convertView View of item * @ param parent parent view of item ' s view * @ return covertView */ @ Override public View getDropDownView ( int position , View convertView , ViewGroup parent ) { } }
final ViewHolder viewHolder ; if ( convertView == null ) { convertView = mLayoutInflater . inflate ( R . layout . item_country , parent , false ) ; viewHolder = new ViewHolder ( ) ; viewHolder . mImageView = ( ImageView ) convertView . findViewById ( R . id . intl_phone_edit__country__item_image ) ; viewHolder . mNameV...
public class BootstrapDrawableFactory { /** * Generates a Drawable for a Bootstrap Label background , according to state parameters * @ param context the current context * @ param bootstrapBrand the BootstrapBrand theming whose colors should be used * @ param rounded whether the corners should be rounded or not ...
int cornerRadius = ( int ) DimenUtils . pixelsFromDpResource ( context , R . dimen . bootstrap_default_corner_radius ) ; GradientDrawable drawable = new GradientDrawable ( ) ; drawable . setColor ( bootstrapBrand . defaultFill ( context ) ) ; // corner radius should be half height if rounded as a " Pill " label drawabl...
public class FlushManager { /** * Adds the nodes to flush stack . * @ param node * the node * @ param eventType * the event type */ private void addNodesToFlushStack ( Node node , EventType eventType ) { } }
Map < NodeLink , Node > children = node . getChildren ( ) ; performOperation ( node , eventType ) ; // If this is a leaf node ( not having any child , no need to go any // deeper if ( children != null ) { Map < NodeLink , Node > oneToOneChildren = new HashMap < NodeLink , Node > ( ) ; Map < NodeLink , Node > oneToManyC...
public class BatchGetOnPremisesInstancesResult { /** * Information about the on - premises instances . * @ param instanceInfos * Information about the on - premises instances . */ public void setInstanceInfos ( java . util . Collection < InstanceInfo > instanceInfos ) { } }
if ( instanceInfos == null ) { this . instanceInfos = null ; return ; } this . instanceInfos = new com . amazonaws . internal . SdkInternalList < InstanceInfo > ( instanceInfos ) ;
public class IsNullOperator { /** * ( non - Javadoc ) * @ see net . timewalker . ffmq4 . common . message . selector . expression . SelectorNode # evaluate ( javax . jms . Message ) */ @ Override public Object evaluate ( Message message ) throws JMSException { } }
Object operandValue = operand . evaluate ( message ) ; return operandValue == null ? Boolean . TRUE : Boolean . FALSE ;
public class BaseSerializer { /** * Serialize a list of DataActions */ public String serializeDataActionList ( List < DataAction > list ) { } }
ObjectMapper om = getObjectMapper ( ) ; try { return om . writeValueAsString ( new ListWrappers . DataActionList ( list ) ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; }
public class MutableDateTime { /** * Set the time from fields . * The date part of this object will be unaffected . * @ param hour the hour * @ param minuteOfHour the minute of the hour * @ param secondOfMinute the second of the minute * @ param millisOfSecond the millisecond of the second * @ throws Illega...
long instant = getChronology ( ) . getDateTimeMillis ( getMillis ( ) , hour , minuteOfHour , secondOfMinute , millisOfSecond ) ; setMillis ( instant ) ;
public class BigMoney { /** * Returns a copy of this monetary value with the amount subtracted . * This subtracts the specified amount from this monetary amount , returning a new object . * No precision is lost in the result . * The scale of the result will be the maximum of the two scales . * For example , ' U...
MoneyUtils . checkNotNull ( amountToSubtract , "Amount must not be null" ) ; if ( amountToSubtract . compareTo ( BigDecimal . ZERO ) == 0 ) { return this ; } BigDecimal newAmount = amount . subtract ( amountToSubtract ) ; return BigMoney . of ( currency , newAmount ) ;
public class InternalXtypeLexer { /** * $ ANTLR start " T _ _ 12" */ public final void mT__12 ( ) throws RecognitionException { } }
try { int _type = T__12 ; int _channel = DEFAULT_TOKEN_CHANNEL ; // InternalXtype . g : 13:7 : ( ' ( ' ) // InternalXtype . g : 13:9 : ' ( ' { match ( '(' ) ; } state . type = _type ; state . channel = _channel ; } finally { }
public class VerificationConditionGenerator { /** * Construct a function or method prototype with a given name and type . The * function or method can then be called elsewhere as an uninterpreted function . * The function or method doesn ' t have a body but is used as a name to be * referred to from assertions . ...
Tuple < WyilFile . Decl . Variable > params = declaration . getParameters ( ) ; Tuple < WyilFile . Decl . Variable > returns = declaration . getReturns ( ) ; WyalFile . VariableDeclaration [ ] parameters = new WyalFile . VariableDeclaration [ params . size ( ) ] ; // second , set initial environment for ( int i = 0 ; i...
public class ChannelFrameworkImpl { /** * @ see com . ibm . wsspi . channelfw . ChannelFramework # stopChain ( String , long ) */ @ Override public synchronized void stopChain ( String chainName , long millisec ) throws ChannelException , ChainException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "stopChain: " + chainName + " time=" + millisec ) ; } if ( null == chainName ) { throw new InvalidChainNameException ( "Null chain name" ) ; } if ( millisec < 0 ) { throw new ChainTimerException ( "Invalid time length give to...
public class IntervalTree { /** * / * From CLR */ private void rotateLeft ( TreeEntry < E > p ) { } }
if ( p != null ) { TreeEntry < E > r = p . right ; p . right = r . left ; if ( r . left != null ) { r . left . parent = p ; } r . parent = p . parent ; if ( p . parent == null ) { root = r ; } else if ( p . parent . left == p ) { p . parent . left = r ; } else { p . parent . right = r ; } r . left = p ; p . parent = r ...
public class CmsObject { /** * Moves a resource to the " lost and found " folder . < p > * The " lost and found " folder is a special system folder . * This operation is used e . g . during import of resources * when a resource with the same name but a different resource ID * already exists in the VFS . In this...
CmsResource resource = readResource ( resourcename , CmsResourceFilter . ALL ) ; return m_securityManager . moveToLostAndFound ( m_context , resource , false ) ;
public class Value { /** * Returns a complete string representation of this * value . * @ return a complete string representation of this * value . */ public String getCompleteValue ( ) { } }
if ( concatValue == null ) { return value ; } else { StringBuffer buf = new StringBuffer ( value ) ; buf . append ( concatValue . getCompleteValue ( ) ) ; return buf . toString ( ) ; }
public class ST_Split { /** * Splits a Polygon with a LineString . * @ param polygon * @ param lineString * @ return */ private static Collection < Polygon > splitPolygonizer ( Polygon polygon , LineString lineString ) throws SQLException { } }
LinkedList < LineString > result = new LinkedList < LineString > ( ) ; ST_ToMultiSegments . createSegments ( polygon . getExteriorRing ( ) , result ) ; result . add ( lineString ) ; int holes = polygon . getNumInteriorRing ( ) ; for ( int i = 0 ; i < holes ; i ++ ) { ST_ToMultiSegments . createSegments ( polygon . getI...
public class Validate { /** * Checks if the given double is a probability ( lies between 0.0 and 1.0 , inclusive ) . * @ param value The double value to validate . * @ param message The error message to include in the exception in case the validation fails . * @ throws ParameterException if the given double value...
if ( ! validation ) return ; Validate . inclusiveBetween ( 0.0 , 1.0 , value , message ) ;
public class MapContentHandler { /** * Register a new content handler . * @ param clazz * the class of the content * @ param handler * the content handler */ public void addContentHandler ( Class < ? extends Content > clazz , JavaMailContentHandler handler ) { } }
map . put ( clazz , handler ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link DocumentType . Add } { @ code > } } */ @ XmlElementDecl ( namespace = "urn:ietf:params:xml:ns:xcap-diff" , name = "add" , scope = DocumentType . class ) public JAXBElement < DocumentType . Add > createDocumentTypeAdd (...
return new JAXBElement < DocumentType . Add > ( _DocumentTypeAdd_QNAME , DocumentType . Add . class , DocumentType . class , value ) ;
public class RefasterJsScanner { /** * Loads the RefasterJs template . This must be called before the scanner is used . */ public void loadRefasterJsTemplate ( String refasterjsTemplate ) throws IOException { } }
checkState ( templateJs == null , "Can't load RefasterJs template since a template is already loaded." ) ; this . templateJs = Thread . currentThread ( ) . getContextClassLoader ( ) . getResource ( refasterjsTemplate ) != null ? Resources . toString ( Resources . getResource ( refasterjsTemplate ) , UTF_8 ) : Files . a...
public class ServiceConfiguration { /** * The DNS names for the service . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setBaseEndpointDnsNames ( java . util . Collection ) } or { @ link # withBaseEndpointDnsNames ( java . util . Collection ) } * if you w...
if ( this . baseEndpointDnsNames == null ) { setBaseEndpointDnsNames ( new com . amazonaws . internal . SdkInternalList < String > ( baseEndpointDnsNames . length ) ) ; } for ( String ele : baseEndpointDnsNames ) { this . baseEndpointDnsNames . add ( ele ) ; } return this ;
public class NodeUtil { /** * Returns true if the node is a lhs value of a destructuring assignment . * < p > For example , x in { @ code var [ x ] = [ 1 ] ; } , { @ code var [ . . . x ] = [ 1 ] ; } , and { @ code var { a : x } = * { a : 1 } } or a . b in { @ code ( [ a . b ] = [ 1 ] ) ; } or { @ code ( { key : a ....
switch ( n . getToken ( ) ) { case NAME : case GETPROP : case GETELEM : return isLhsByDestructuringHelper ( n ) ; default : return false ; }
public class CmsSearchTab { /** * Sets the form fields to the values from the stored gallery search . < p > * @ param search a previously stored gallery search */ public void fillParams ( CmsGallerySearchBean search ) { } }
m_localeSelection . setFormValue ( search . getLocale ( ) , false ) ; m_searchInput . setFormValueAsString ( search . getQuery ( ) ) ; m_includeExpiredCheckBox . setChecked ( search . isIncludeExpired ( ) ) ; if ( search . getDateCreatedStart ( ) > 9 ) { m_dateCreatedStartDateBox . setValue ( new Date ( search . getDat...
public class FoxHttpRequestBuilder { /** * Get the FoxHttpRequest of this builder * @ return FoxHttpRequest */ public FoxHttpRequest build ( ) throws MalformedURLException , FoxHttpRequestException { } }
if ( this . url != null ) { foxHttpRequest . setUrl ( this . url ) ; } return foxHttpRequest ;
public class Compiler { /** * Compile a variable reference . * @ param opPos The current position in the m _ opMap array . * @ return reference to { @ link org . apache . xpath . operations . Variable } instance . * @ throws TransformerException if a error occurs creating the Expression . */ protected Expression ...
Variable var = new Variable ( ) ; opPos = getFirstChildPos ( opPos ) ; int nsPos = getOp ( opPos ) ; java . lang . String namespace = ( OpCodes . EMPTY == nsPos ) ? null : ( java . lang . String ) getTokenQueue ( ) . elementAt ( nsPos ) ; java . lang . String localname = ( java . lang . String ) getTokenQueue ( ) . ele...
public class Options { /** * Returns the value of an option as an integer , or - 1 if not defined . */ public static int intValue ( String option ) { } }
String s = value ( option ) ; if ( s != null ) { try { int val = Integer . parseInt ( s ) ; if ( val > 0 ) return ( val ) ; } catch ( NumberFormatException e ) { } } return ( - 1 ) ;
public class FluoWait { /** * Wait until a scan of the table completes without seeing notifications AND without the Oracle * issuing any timestamps during the scan . */ private static void waitUntilFinished ( FluoConfiguration config ) { } }
try ( Environment env = new Environment ( config ) ) { List < TableRange > ranges = getRanges ( env ) ; outer : while ( true ) { long ts1 = env . getSharedResources ( ) . getOracleClient ( ) . getStamp ( ) . getTxTimestamp ( ) ; for ( TableRange range : ranges ) { boolean sawNotifications = waitTillNoNotifications ( en...
public class AWSCodeCommitClient { /** * Returns information about comments made on the comparison between two commits . * @ param getCommentsForComparedCommitRequest * @ return Result of the GetCommentsForComparedCommit operation returned by the service . * @ throws RepositoryNameRequiredException * A reposito...
request = beforeClientExecution ( request ) ; return executeGetCommentsForComparedCommit ( request ) ;
public class Encoding { /** * Encodes a byte array to a Base64 encoded String . * < br / > ( cf . RFC 1341 section 5.2) * This implementation heavily outperforms sun . misc . BASE64Encoder , which is * not " officially " available anyway ( about four times faster on 1.3 and * about double speed on 1.4 ) . * @...
if ( null == code ) return null ; if ( 0 == code . length ) return new String ( ) ; int len = code . length ; // remainder of the encoding process int rem = len % 3 ; // size of the destination byte array byte [ ] dst = new byte [ 4 + ( ( ( len - 1 ) / 3 ) << 2 ) + ( len / 57 ) ] ; // actual column of the destination s...
public class AbstractBaseController { /** * Build an event handler by reflection to wrap the event adapter given . * @ param eventAdapter the instance of an eventAdapter * @ param adapterClass the adapter class used by the handler constructor * @ param handlerClass the handler class to build * @ return the requ...
try { return handlerClass . getDeclaredConstructor ( adapterClass ) . newInstance ( eventAdapter ) ; } catch ( InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e ) { throw new CoreException ( "Impossible to build event han...
public class WebContainerListener { /** * { @ inheritDoc } */ @ Override public ClassLoader getClassLoader ( ComponentMetaData metaData ) { } }
ModuleMetaData moduleMetaData = ( metaData != null ) ? metaData . getModuleMetaData ( ) : null ; if ( moduleMetaData instanceof WebModuleMetaData ) { WebAppConfiguration webAppConfiguration = ( WebAppConfiguration ) ( ( WebModuleMetaData ) moduleMetaData ) . getConfiguration ( ) ; return webAppConfiguration . getWebApp...
public class SoyFileSet { /** * Performs the parsing and extraction logic . */ private SoyMsgBundle doExtractMsgs ( ) { } }
// extractMsgs disables a bunch of passes since it is typically not configured with things // like global definitions , type definitions , plugins , etc . SoyFileSetNode soyTree = parse ( passManagerBuilder ( ) . allowUnknownGlobals ( ) . allowV1Expression ( ) . setTypeRegistry ( SoyTypeRegistry . DEFAULT_UNKNOWN ) // ...
public class MtasDataCollector { /** * Inits the new list basic . * @ param maxNumberOfTerms the max number of terms * @ throws IOException Signals that an I / O exception has occurred . */ @ SuppressWarnings ( "unchecked" ) private void initNewListBasic ( int maxNumberOfTerms ) throws IOException { } }
if ( ! closed ) { position = 0 ; newPosition = 0 ; newCurrentPosition = 0 ; newSize = maxNumberOfTerms + size ; newKeyList = new String [ newSize ] ; newSourceNumberList = new int [ newSize ] ; newErrorNumber = new int [ newSize ] ; newErrorList = ( HashMap < String , Integer > [ ] ) new HashMap < ? , ? > [ newSize ] ;...
public class ListSecretVersionIdsResult { /** * The list of the currently available versions of the specified secret . * @ param versions * The list of the currently available versions of the specified secret . */ public void setVersions ( java . util . Collection < SecretVersionsListEntry > versions ) { } }
if ( versions == null ) { this . versions = null ; return ; } this . versions = new java . util . ArrayList < SecretVersionsListEntry > ( versions ) ;
public class CSVSparkTransform { /** * Runs the transform process * @ param batch the record to transform * @ return the transformed record */ public BatchCSVRecord transform ( BatchCSVRecord batch ) { } }
BatchCSVRecord batchCSVRecord = new BatchCSVRecord ( ) ; List < List < Writable > > converted = execute ( toArrowWritables ( toArrowColumnsString ( bufferAllocator , transformProcess . getInitialSchema ( ) , batch . getRecordsAsString ( ) ) , transformProcess . getInitialSchema ( ) ) , transformProcess ) ; int numCols ...
public class Table { /** * Set the style of a column . * @ param col The column number * @ param ts The style to be used , make sure the style is of type * TableFamilyStyle . STYLEFAMILY _ TABLECOLUMN * @ throws FastOdsException Thrown if col has an invalid value . */ public void setColumnStyle ( final int col ...
if ( this . appender . isPreambleWritten ( ) ) throw new IllegalStateException ( ) ; this . builder . setColumnStyle ( col , ts ) ;
public class VideoPositionTarget { /** * Sets the videoPositionWithinPod value for this VideoPositionTarget . * @ param videoPositionWithinPod * The video position within a pod to target . To target a video * position or a bumper position , * this value must be null . To target a position within * a pod this va...
this . videoPositionWithinPod = videoPositionWithinPod ;
public class ObjectMap { /** * Returns the value associated with the key , or null . */ public V remove ( K key ) { } }
int hashCode = key . hashCode ( ) ; int index = hashCode & mask ; if ( key . equals ( keyTable [ index ] ) ) { keyTable [ index ] = null ; V oldValue = valueTable [ index ] ; valueTable [ index ] = null ; size -- ; return oldValue ; } index = hash2 ( hashCode ) ; if ( key . equals ( keyTable [ index ] ) ) { keyTable [ ...
public class FactoryInterpolation { /** * Pixel based interpolation on multi - band image * @ param min Minimum possible pixel value . Inclusive . * @ param max Maximum possible pixel value . Inclusive . * @ param type Interpolation type * @ param imageType Type of input image */ public static < T extends Image...
switch ( imageType . getFamily ( ) ) { case PLANAR : return ( InterpolatePixelMB < T > ) createPixelPL ( ( InterpolatePixelS ) createPixelS ( min , max , type , borderType , imageType . getDataType ( ) ) ) ; case GRAY : { InterpolatePixelS interpS = createPixelS ( min , max , type , borderType , imageType . getImageCla...
public class SpanUniqueIdGenerator { /** * Reverse method to the { @ link SpanUniqueIdGenerator # toUnique ( Span ) } to generate original * id from the unique id . * @ param span Span with unique id . * @ return Original id of the span . */ public static String toOriginal ( Span span ) { } }
String id = span . getId ( ) ; if ( span . clientSpan ( ) ) { int suffixIndex = id . lastIndexOf ( CLIENT_ID_SUFFIX ) ; if ( suffixIndex > 0 ) { id = id . substring ( 0 , suffixIndex ) ; } } return id ;
public class DefaultTraceCollector { /** * This method merges an inner Producer node information into its * containing Producer node , before removing the inner node . * @ param inner * @ param outer */ protected void mergeProducer ( Producer inner , Producer outer ) { } }
if ( log . isLoggable ( Level . FINEST ) ) { log . finest ( "Merging Producer = " + inner + " into Producer = " + outer ) ; } // NOTE : For now , assumption is that inner Producer is equivalent to the outer // and results from instrumentation rules being triggered multiple times // for the same message . // Merge corre...
public class RDBMetadata { /** * creates a view for SQLQueryParser * ( NOTE : these views are simply names for complex non - parsable subqueries , not database views ) * TODO : make the second argument a callback ( which is called only when needed ) * TODO : make it re - use parser views for the same SQL * @ pa...
if ( ! isStillMutable ( ) ) { throw new IllegalStateException ( "Too late! Parser views must be created before freezing the DBMetadata" ) ; } RelationID id = getQuotedIDFactory ( ) . createRelationID ( null , String . format ( "view_%s" , parserViewCounter ++ ) ) ; ParserViewDefinition view = new ParserViewDefinition (...
public class AJAXBroadcastComponent { /** * Execute the ajax call when ajax syntax was found ajax : < command > * @ param context * @ param command * @ return */ private Object executeAjaxCalls ( FacesContext context , String command ) { } }
Object result = null ; int pos = command . indexOf ( "ajax:" ) ; while ( pos >= 0 ) { // the command may contain several AJAX and // JavaScript calls , in arbitrary order String el = command . substring ( pos + "ajax:" . length ( ) ) ; if ( el . contains ( "javascript:" ) ) { int end = el . indexOf ( "javascript:" ) ; ...
public class ImmutableRoaringBitmap { /** * Cardinality of the bitwise XOR ( symmetric difference ) operation . * The provided bitmaps are * not * modified . This operation is thread - safe * as long as the provided bitmaps remain unchanged . * @ param x1 first bitmap * @ param x2 other bitmap * @ return card...
return x1 . getCardinality ( ) + x2 . getCardinality ( ) - 2 * andCardinality ( x1 , x2 ) ;
public class ByteBuddy { /** * Rebases a package . This offers an opportunity to add annotations to the package definition . Packages are defined * by classes named { @ code package - info } without any methods or fields but permit annotations . Any field or method * definition will cause an { @ link IllegalStateEx...
return rebase ( new PackageDescription . ForLoadedPackage ( aPackage ) , classFileLocator ) ;
public class DbConfiguration { /** * Provides a list of all connection wrappers corresponding to a given environment . * @ param env name of environment , such as " development " , " production " , etc . * @ return a list of all connection wrappers corresponding to a given environment . */ public static List < Conn...
return connectionWrappers . get ( env ) == null ? new ArrayList < > ( ) : connectionWrappers . get ( env ) ;
public class SimpleObserver { /** * Register this observer with the JCR event listeners * @ throws RepositoryException if repository exception occurred */ @ PostConstruct public void buildListener ( ) throws RepositoryException { } }
LOGGER . debug ( "Constructing an observer for JCR events..." ) ; session = getJcrSession ( repository . login ( ) ) ; session . getWorkspace ( ) . getObservationManager ( ) . addEventListener ( this , EVENT_TYPES , "/" , true , null , null , false ) ; session . save ( ) ;
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public FNCPatTech createFNCPatTechFromString ( EDataType eDataType , String initialValue ) { } }
FNCPatTech result = FNCPatTech . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
public class FileUtils { /** * Return file from context . getFilesDir ( ) / fileName * @ param context application context * @ param fileName path to the file * @ return instance of the file object . */ @ NonNull public static File getFile ( @ NonNull Context context , @ NonNull String fileName ) { } }
return new File ( context . getFilesDir ( ) , fileName ) ;
public class StringUtilities { /** * Returns the given byte array after if it has been encoded . * @ param bytes The byte array to be encoded * @ return The encoded string */ public static String encodeBytes ( byte [ ] bytes ) { } }
String ret = null ; try { // Obfuscate the string if ( bytes != null ) ret = new String ( Base64 . encodeBase64 ( bytes ) ) ; } catch ( NoClassDefFoundError e ) { ret = new String ( bytes ) ; System . out . println ( "WARNING: unable to encode: " + e . getClass ( ) . getName ( ) + ": " + e . getMessage ( ) ) ; } return...