signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class PathOverlay { /** * Draw a great circle . * Calculate a point for every 100km along the path . * @ param startPoint start point of the great circle * @ param endPoint end point of the great circle */ public void addGreatCircle ( final GeoPoint startPoint , final GeoPoint endPoint ) { } }
// get the great circle path length in meters final int greatCircleLength = ( int ) startPoint . distanceToAsDouble ( endPoint ) ; // add one point for every 100kms of the great circle path final int numberOfPoints = greatCircleLength / 100000 ; addGreatCircle ( startPoint , endPoint , numberOfPoints ) ;
public class DraweeHolder { /** * Callback used to notify about top - level - drawable ' s visibility changes . */ @ Override public void onVisibilityChange ( boolean isVisible ) { } }
if ( mIsVisible == isVisible ) { return ; } mEventTracker . recordEvent ( isVisible ? Event . ON_DRAWABLE_SHOW : Event . ON_DRAWABLE_HIDE ) ; mIsVisible = isVisible ; attachOrDetachController ( ) ;
public class Dispatcher { /** * - - methods called from handler */ void handlerProcessTask ( Task task ) { } }
assertDispatcherThread ( ) ; SerialTaskQueue taskQueue = mQueuesMap . get ( task . subscriberCallback . queue ) ; if ( taskQueue == null ) { taskQueue = new SerialTaskQueue ( task . subscriberCallback . queue ) ; mQueuesMap . put ( task . subscriberCallback . queue , taskQueue ) ; mQueuesList . add ( taskQueue ) ; } ta...
public class CompiledFEELSemanticMappings { /** * Represent a [ e1 , e2 , e3 ] construct . */ @ SafeVarargs @ SuppressWarnings ( "varargs" ) public static < T > List < T > list ( T ... a ) { } }
ArrayList < T > result = new ArrayList < T > ( ) ; if ( a == null ) { result . add ( null ) ; return result ; } for ( T elem : a ) { result . add ( elem ) ; } return result ;
public class HtmlWriter { /** * Writes out a CSS property . * @ param prop a CSS property * @ param value the value of the CSS property * @ throws IOException */ protected void writeCssProperty ( String prop , String value ) throws IOException { } }
write ( new StringBuffer ( prop ) . append ( ": " ) . append ( value ) . append ( "; " ) . toString ( ) ) ;
public class GetDiscoveredResourceCountsResult { /** * The list of < code > ResourceCount < / code > objects . Each object is listed in descending order by the number of * resources . * @ param resourceCounts * The list of < code > ResourceCount < / code > objects . Each object is listed in descending order by th...
if ( resourceCounts == null ) { this . resourceCounts = null ; return ; } this . resourceCounts = new com . amazonaws . internal . SdkInternalList < ResourceCount > ( resourceCounts ) ;
public class ApiOvhTelephony { /** * Alter this object properties * REST : PUT / telephony / { billingAccount } / scheduler / { serviceName } * @ param body [ required ] New object properties * @ param billingAccount [ required ] The name of your billingAccount * @ param serviceName [ required ] */ public void ...
String qPath = "/telephony/{billingAccount}/scheduler/{serviceName}" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; exec ( qPath , "PUT" , sb . toString ( ) , body ) ;
public class ApiOvhXdsl { /** * Get this object properties * REST : GET / xdsl / spare / { spare } * @ param spare [ required ] The internal name of your spare */ public OvhXdslSpare spare_spare_GET ( String spare ) throws IOException { } }
String qPath = "/xdsl/spare/{spare}" ; StringBuilder sb = path ( qPath , spare ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhXdslSpare . class ) ;
public class UserManagedCacheBuilder { /** * Adds one or more { @ link CacheEventListenerConfiguration } to the returned builder . * @ param cacheEventListenerConfigurations the cache event listener configurations * @ return a new builders with the added event listener configurations * @ see # withEventDispatcher...
UserManagedCacheBuilder < K , V , T > otherBuilder = new UserManagedCacheBuilder < > ( this ) ; otherBuilder . eventListenerConfigurations . addAll ( Arrays . asList ( cacheEventListenerConfigurations ) ) ; return otherBuilder ;
public class RxLoaderManager { /** * Creates a new { @ link me . tatarka . rxloader . RxLoader } that manages the given { @ link * rx . Observable } . It uses the { @ link me . tatarka . rxloader . RxLoaderManager # DEFAULT } tag . This * should be called in { @ link android . app . Activity # onCreate ( android . ...
return new RxLoader1 < A , T > ( manager , DEFAULT , observableFunc , observer ) ;
public class SeekBar { @ Override public boolean onTouchEvent ( MotionEvent event ) { } }
if ( ! isEnabled ( ) ) return false ; if ( event . getAction ( ) == MotionEvent . ACTION_DOWN ) { if ( radiusAnimator != null ) radiusAnimator . end ( ) ; radiusAnimator = ValueAnimator . ofFloat ( thumbRadius , THUMB_RADIUS_DRAGGED ) ; radiusAnimator . setDuration ( 200 ) ; radiusAnimator . setInterpolator ( interpola...
public class Path { /** * Resolve original path if the path is a version history or launch path . * If the path does not point to any of these locations it is returned unchanged . * @ param path Path * @ param resourceResolver Resource resolver * @ return Path that is not a version history or launch path */ pub...
if ( StringUtils . isEmpty ( path ) ) { return null ; } Matcher versionHistoryMatcher = VERSION_HISTORY_PATTERN . matcher ( path ) ; if ( versionHistoryMatcher . matches ( ) ) { return "/content" + versionHistoryMatcher . group ( 1 ) ; } Matcher legacyVersionHistoryMatcher = LEGACY_VERSION_HISTORY_PATTERN . matcher ( p...
public class CommsByteBuffer { /** * Puts a message into the byte buffer using the < code > encodeFast ( ) < / code > method of encoding * messages . This method takes account of any < i > capabilities < / i > negotiated at the point the * connection was established . * < p > This method is used for putting an en...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "putMessage" , new Object [ ] { message , commsConnection , conversation } ) ; int messageLength = putMessgeWithoutEncode ( encodeFast ( message , commsConnection , conversation ) ) ; if ( TraceComponent . isAnyTracin...
public class BytesMessageImpl { /** * / * ( non - Javadoc ) * @ see net . timewalker . ffmq4 . common . message . AbstractMessage # copy ( ) */ @ Override public AbstractMessage copy ( ) { } }
BytesMessageImpl clone = new BytesMessageImpl ( ) ; copyCommonFields ( clone ) ; tidyUp ( ) ; clone . body = this . body ; return clone ;
public class Scheduler { /** * Checks if the scheduler is initialized and started * @ return true if the scheduler is started , false otherwise * @ throws MangooSchedulerException if an error occurred accessing the scheduler */ public boolean isStarted ( ) throws MangooSchedulerException { } }
boolean started ; try { started = this . quartzScheduler != null && this . quartzScheduler . isStarted ( ) ; } catch ( SchedulerException e ) { throw new MangooSchedulerException ( e ) ; } return started ;
public class DeleteMethodHandler { /** * This method delete entity . * @ param entity is null always . If it is not null then returns BAD _ REQUEST status * @ return status of request * @ throws com . sdl . odata . api . processor . datasource . ODataDataSourceException in case of any error */ @ Override public P...
if ( ODataUriUtil . isRefPathUri ( getoDataUri ( ) ) ) { return processLink ( ( ODataLink ) entity ) ; } else { if ( entity != null ) { throw new ODataBadRequestException ( "The body of a DELETE request must be empty." ) ; } return processEntity ( ) ; }
public class DatabaseUtils { /** * Partition by 1000 elements a list of input and execute a consumer on each part . * The goal is to prevent issue with ORACLE when there ' s more than 1000 elements in a ' in ( ' X ' , ' Y ' , . . . ) ' * and with MsSQL when there ' s more than 2000 parameters in a query * @ param...
Iterable < List < INPUT > > partitions = toUniqueAndSortedPartitions ( inputs , partitionSizeManipulations ) ; for ( List < INPUT > partition : partitions ) { consumer . accept ( partition ) ; }
public class Path3f { /** * FIXME TO BE IMPLEMENTED IN POLYLINE */ public double length ( ) { } }
if ( this . isEmpty ( ) ) return 0 ; double length = 0 ; PathIterator3f pi = getPathIterator ( MathConstants . SPLINE_APPROXIMATION_RATIO ) ; AbstractPathElement3F pathElement = pi . next ( ) ; if ( pathElement . type != PathElementType . MOVE_TO ) { throw new IllegalArgumentException ( "missing initial moveto in path ...
public class PentaTreeNode { /** * Clear the tree . * < p > Caution : this method also destroyes the * links between the child nodes inside the tree . * If you want to unlink the first - level * child node with * this node but leave the rest of the tree * unchanged , please call < code > setChildAt ( i , nu...
if ( this . child1 != null ) { final N child = this . child1 ; setChildAt ( 0 , null ) ; child . clear ( ) ; } if ( this . child2 != null ) { final N child = this . child2 ; setChildAt ( 1 , null ) ; child . clear ( ) ; } if ( this . child3 != null ) { final N child = this . child3 ; setChildAt ( 2 , null ) ; child . c...
public class PerfCounterMap { /** * Tracks a generic call execution by reporting the execution duration . This method should be used for successful calls only . * @ param counter the name of the counter to update . * @ param executionDuration the duration of the execution call to track in this counter . * @ param...
this . get ( counter ) . update ( executionDuration , success ) ;
public class PactDslRootValue { /** * Value that must match the given timestamp format * @ param format timestamp format */ public static PactDslRootValue timestamp ( String format ) { } }
PactDslRootValue value = new PactDslRootValue ( ) ; value . generators . addGenerator ( Category . BODY , "" , new DateTimeGenerator ( format ) ) ; FastDateFormat instance = FastDateFormat . getInstance ( format ) ; value . setValue ( instance . format ( new Date ( DATE_2000 ) ) ) ; value . setMatcher ( value . matchTi...
public class cachepolicylabel_stats { /** * Use this API to fetch the statistics of all cachepolicylabel _ stats resources that are configured on netscaler . */ public static cachepolicylabel_stats [ ] get ( nitro_service service ) throws Exception { } }
cachepolicylabel_stats obj = new cachepolicylabel_stats ( ) ; cachepolicylabel_stats [ ] response = ( cachepolicylabel_stats [ ] ) obj . stat_resources ( service ) ; return response ;
public class CrdtValueDelegate { /** * Encodes the given value to a string for internal storage . * @ param value the value to encode * @ return the encoded value */ private String encode ( Object value ) { } }
return BaseEncoding . base16 ( ) . encode ( valueSerializer . encode ( value ) ) ;
public class CmsToolbarClipboardView { /** * Adds a modified entry . < p > * @ param entry the entry * @ param previousPath the previous path */ public void addModified ( CmsClientSitemapEntry entry , String previousPath ) { } }
removeDeleted ( entry . getId ( ) . toString ( ) ) ; removeModified ( entry . getId ( ) . toString ( ) ) ; getModified ( ) . insertItem ( createModifiedItem ( entry ) , 0 ) ; m_clipboardButton . enableClearModified ( true ) ;
public class WindowSpecificationImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . WINDOW_SPECIFICATION__FLAGS : return FLAGS_EDEFAULT == null ? flags != null : ! FLAGS_EDEFAULT . equals ( flags ) ; case AfplibPackage . WINDOW_SPECIFICATION__RES3 : return RES3_EDEFAULT == null ? res3 != null : ! RES3_EDEFAULT . equals ( res3 ) ; case AfplibPackage . WINDOW_...
public class UriUtils { /** * Encodes the given URI host with the given encoding . * @ param host the host to be encoded * @ param encoding the character encoding to encode to * @ return the encoded host * @ throws UnsupportedEncodingException when the given encoding parameter is not supported */ public static ...
return HierarchicalUriComponents . encodeUriComponent ( host , encoding , HierarchicalUriComponents . Type . HOST_IPV4 ) ;
public class Logging { /** * Log a message at the ' fine ' debugging level . * You should check isDebugging ( ) before building the message . * @ param message Informational log message . * @ param e Exception */ public void debug ( CharSequence message , Throwable e ) { } }
log ( Level . FINE , message , e ) ;
public class Utils { /** * The method copyFiles being defined */ public static void copyFiles ( File src , File dest ) throws IOException { } }
if ( src . isDirectory ( ) ) { dest . mkdirs ( ) ; String list [ ] = src . list ( ) ; for ( String fileName : list ) { String dest1 = dest . getPath ( ) + "/" + fileName ; String src1 = src . getPath ( ) + "/" + fileName ; // i . e : avoid . svn directory File src1_ = new File ( src1 ) ; File dest1_ = new File ( dest1 ...
public class AmazonEC2Client { /** * Associates a set of DHCP options ( that you ' ve previously created ) with the specified VPC , or associates no DHCP * options with the VPC . * After you associate the options with the VPC , any existing instances and all new instances that you launch in * that VPC use the opt...
request = beforeClientExecution ( request ) ; return executeAssociateDhcpOptions ( request ) ;
public class JAXBUtils { /** * Convert { @ link Date } to { @ link XMLGregorianCalendar } . * @ param date * XML entity */ public static XMLGregorianCalendar convertDateToXMLGregorianCalendar ( final Date date ) { } }
try { GregorianCalendar cal = new GregorianCalendar ( ) ; cal . setTime ( date ) ; XMLGregorianCalendar calXml = DatatypeFactory . newInstance ( ) . newXMLGregorianCalendar ( cal . get ( Calendar . YEAR ) , cal . get ( Calendar . MONTH ) + 1 , cal . get ( Calendar . DAY_OF_MONTH ) , cal . get ( Calendar . HOUR_OF_DAY )...
public class DateTime { /** * Get this object as a DateTime , returning < code > this < / code > if possible . * @ param chronology chronology to apply , or ISOChronology if null * @ return a DateTime using the same millis */ public DateTime toDateTime ( Chronology chronology ) { } }
chronology = DateTimeUtils . getChronology ( chronology ) ; if ( getChronology ( ) == chronology ) { return this ; } return super . toDateTime ( chronology ) ;
public class Formula { /** * Generates a BDD from this formula with a given variable ordering . This is done by generating a new BDD factory , * generating the variable order for this formula , and building a new BDD . If more sophisticated operations should * be performed on the BDD or more than one formula should...
final int varNum = this . variables ( ) . size ( ) ; final BDDFactory factory = new BDDFactory ( varNum * 30 , varNum * 20 , this . factory ( ) ) ; if ( variableOrdering == null ) { factory . setNumberOfVars ( varNum ) ; } else { try { final VariableOrderingProvider provider = variableOrdering . provider ( ) . newInsta...
public class Settings { /** * Sets a property value only if the array value is not null and not empty . * @ param key the key for the property * @ param value the value for the property */ public void setArrayIfNotEmpty ( @ NotNull final String key , @ Nullable final List < String > value ) { } }
if ( null != value && ! value . isEmpty ( ) ) { setString ( key , new Gson ( ) . toJson ( value ) ) ; }
public class Graph { /** * Groups by vertex and computes a GroupReduce transformation over the edge values of each vertex . * The edgesFunction applied on the edges has access to both the id and the value * of the grouping vertex . * < p > For each vertex , the edgesFunction can iterate over all edges of this ver...
switch ( direction ) { case IN : return vertices . coGroup ( edges ) . where ( 0 ) . equalTo ( 1 ) . with ( new ApplyCoGroupFunction < > ( edgesFunction ) ) . name ( "GroupReduce on in-edges" ) ; case OUT : return vertices . coGroup ( edges ) . where ( 0 ) . equalTo ( 0 ) . with ( new ApplyCoGroupFunction < > ( edgesFu...
public class GetRouteResponseRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetRouteResponseRequest getRouteResponseRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getRouteResponseRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getRouteResponseRequest . getApiId ( ) , APIID_BINDING ) ; protocolMarshaller . marshall ( getRouteResponseRequest . getRouteId ( ) , ROUTEID_BINDING ) ; protoco...
public class CmsDateRestrictionParser { /** * Parses a date . < p > * @ param dateLoc the location of the date * @ return the date , or null if it could not be parsed */ private Date parseDate ( CmsXmlContentValueLocation dateLoc ) { } }
if ( dateLoc == null ) { return null ; } String dateStr = dateLoc . getValue ( ) . getStringValue ( m_cms ) ; if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( dateStr ) ) { return null ; } try { return new Date ( Long . parseLong ( dateStr ) ) ; } catch ( Exception e ) { LOG . info ( e . getLocalizedMessage ( ) + " date ...
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link GridType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link GridType } { @ code > } */ @ XmlElement...
return new JAXBElement < GridType > ( _Grid_QNAME , GridType . class , null , value ) ;
public class FairSchedulerServlet { /** * Print the filter information for pools and users * @ param out Where the output is dumped * @ param poolFilter Comma separated list of pools , null for none * @ param userSet Comma separated list of users , null for none * @ param showAllLink Link to show everything */ ...
if ( userFilter != null || poolFilter != null ) { StringBuilder customizedInfo = new StringBuilder ( "Only showing " ) ; if ( poolFilter != null ) { customizedInfo . append ( "pool(s) " + poolFilter ) ; } if ( userFilter != null ) { if ( customizedInfo . length ( ) != 0 ) { customizedInfo . append ( " and " ) ; } custo...
public class HamtPMap { /** * Returns a new map with the given key - value pair added . If the value is already present , then * this same map will be returned . */ @ Override public HamtPMap < K , V > plus ( K key , V value ) { } }
return ! isEmpty ( ) ? plus ( key , hash ( key ) , checkNotNull ( value ) ) : new HamtPMap < > ( key , hash ( key ) , value , 0 , emptyChildren ( ) ) ;
public class DescribeSpotFleetInstancesResult { /** * The running instances . This list is refreshed periodically and might be out of date . * @ return The running instances . This list is refreshed periodically and might be out of date . */ public java . util . List < ActiveInstance > getActiveInstances ( ) { } }
if ( activeInstances == null ) { activeInstances = new com . amazonaws . internal . SdkInternalList < ActiveInstance > ( ) ; } return activeInstances ;
public class MockEc2Controller { /** * List mock ec2 instances in current aws - mock . * @ param instanceIDs * a filter of specified instance IDs for the target instance to describe * @ return a collection of { @ link AbstractMockEc2Instance } with specified instance IDs , or all of the mock ec2 * instances if ...
if ( null == instanceIDs || instanceIDs . size ( ) == 0 ) { return allMockEc2Instances . values ( ) ; } else { return getInstances ( instanceIDs ) ; }
public class A_CmsPatternPanelController { /** * Sets the interval . * @ param interval the interval to set . */ void setInterval ( String interval ) { } }
final int i = CmsSerialDateUtil . toIntWithDefault ( interval , - 1 ) ; if ( m_model . getInterval ( ) != i ) { removeExceptionsOnChange ( new Command ( ) { public void execute ( ) { m_model . setInterval ( i ) ; onValueChange ( ) ; } } ) ; }
public class CommerceCountryPersistenceImpl { /** * Removes the commerce country with the primary key from the database . Also notifies the appropriate model listeners . * @ param primaryKey the primary key of the commerce country * @ return the commerce country that was removed * @ throws NoSuchCountryException ...
Session session = null ; try { session = openSession ( ) ; CommerceCountry commerceCountry = ( CommerceCountry ) session . get ( CommerceCountryImpl . class , primaryKey ) ; if ( commerceCountry == null ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey ) ; } throw new N...
public class NetworkInterfacesInner { /** * Gets all route tables applied to a network interface . * @ param resourceGroupName The name of the resource group . * @ param networkInterfaceName The name of the network interface . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ thro...
return beginGetEffectiveRouteTableWithServiceResponseAsync ( resourceGroupName , networkInterfaceName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class LocalQPConsumerKey { /** * Make this key not ready */ public void markNotReady ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "markNotReady" ) ; ready = false ; if ( keyGroup != null ) keyGroup . markNotReady ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "markNotReady" ) ;
public class CmsShellCommands { /** * Sets a site parameter and writes back the updated system configuration . < p > * @ param siteRoot the root path used to identify the site * @ param key the parameter key * @ param value the parameter value */ public void setSiteParam ( String siteRoot , String key , String va...
CmsSite site = OpenCms . getSiteManager ( ) . getSiteForRootPath ( siteRoot ) ; if ( site == null ) { throw new IllegalArgumentException ( "No site found for path: " + siteRoot ) ; } else { site . getParameters ( ) . put ( key , value ) ; OpenCms . writeConfiguration ( CmsSitesConfiguration . class ) ; }
public class WebhookClient { /** * Sends the provided { @ code byte [ ] } data to this webhook . * < br > Use { @ link WebhookMessage # files ( String , Object , Object . . . ) } to send up to 10 files ! * @ param data * The file data to send * @ param fileName * The name that should be used for this file *...
return send ( new WebhookMessageBuilder ( ) . addFile ( fileName , data ) . build ( ) ) ;
public class Table { /** * Appends a column range to the linked list of column ranges . * @ param colRange the range to append */ private void appendColumnRange ( ColumnRange colRange ) { } }
if ( last == null ) { first = colRange ; last = colRange ; } else { last . setNext ( colRange ) ; last = colRange ; }
public class HMac { /** * 生成摘要 * @ param data 数据bytes * @ return 摘要bytes */ public byte [ ] digest ( byte [ ] data ) { } }
byte [ ] result ; try { result = mac . doFinal ( data ) ; } finally { mac . reset ( ) ; } return result ;
public class PKITrustManagerFactory { /** * Initializes this factory with a source of certificate authorities and * related trust material . * @ param keyStore * The key store or null * @ throws KeyStoreException * if the initialization fails . */ @ Override protected void engineInit ( KeyStore keyStore ) thr...
try { this . engineInit ( new CertPathTrustManagerParameters ( new X509ProxyCertPathParameters ( keyStore , null , null , false ) ) ) ; } catch ( InvalidAlgorithmParameterException e ) { throw new KeyStoreException ( e ) ; }
public class JournalSegment { /** * Starts checkpoint processing . A checkpoint start changes the epoch * ID for new journal entries , but does not yet close the previous epoch . * Journal entries written between checkpointStart ( ) and checkpointEnd ( ) * belong to the successor epoch . */ public void checkpoint...
if ( _isWhileCheckpoint ) { throw new IllegalStateException ( ) ; } _isWhileCheckpoint = true ; long sequence = ++ _sequence ; setSequence ( sequence ) ; byte [ ] headerBuffer = _headerBuffer ; BitsUtil . writeInt16 ( headerBuffer , 0 , CHECKPOINT_START ) ; writeImpl ( headerBuffer , 0 , 2 ) ; _lastCheckpointStart = _i...
public class ResolvedTargetsMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ResolvedTargets resolvedTargets , ProtocolMarshaller protocolMarshaller ) { } }
if ( resolvedTargets == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( resolvedTargets . getParameterValues ( ) , PARAMETERVALUES_BINDING ) ; protocolMarshaller . marshall ( resolvedTargets . getTruncated ( ) , TRUNCATED_BINDING ) ; } catch...
public class CommerceOrderNoteUtil { /** * Removes the commerce order note with the primary key from the database . Also notifies the appropriate model listeners . * @ param commerceOrderNoteId the primary key of the commerce order note * @ return the commerce order note that was removed * @ throws NoSuchOrderNot...
return getPersistence ( ) . remove ( commerceOrderNoteId ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EEnum getIfcActuatorTypeEnum ( ) { } }
if ( ifcActuatorTypeEnumEEnum == null ) { ifcActuatorTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 907 ) ; } return ifcActuatorTypeEnumEEnum ;
public class LoggingService { /** * - - - - - Service methods */ @ Override protected void initService ( ) { } }
RESTService . instance ( ) . registerCommands ( Arrays . asList ( LogServiceAppCmd . class ) ) ; RESTService . instance ( ) . registerCommands ( cmdClasses , this ) ;
public class JmesPathEvaluationVisitor { /** * Evaluates a subexpression by evaluating the expression on * the left with the original JSON document and then evaluating * the expression on the right with the result of the left * expression evaluation . * @ param subExpression JmesPath subexpression type * @ pa...
JsonNode prelimnaryResult = subExpression . getExpressions ( ) . get ( 0 ) . accept ( this , input ) ; for ( int i = 1 ; i < subExpression . getExpressions ( ) . size ( ) ; i ++ ) { prelimnaryResult = subExpression . getExpressions ( ) . get ( i ) . accept ( this , prelimnaryResult ) ; } return prelimnaryResult ;
public class RxPresenter { /** * Starts the given restartable . * @ param restartableId id of the restartable */ public void start ( int restartableId ) { } }
stop ( restartableId ) ; requested . add ( restartableId ) ; restartableSubscriptions . put ( restartableId , restartables . get ( restartableId ) . call ( ) ) ;
public class AbstractPropertyEditor { /** * Given the name of a property ' s name as indicated in the OWL file , this method converts the name * to a Java compatible name . * @ param owlName the property name as a string * @ return the Java compatible name of the property */ private static String getJavaName ( St...
// Since java does not allow ' - ' replace them all with ' _ ' String s = owlName . replaceAll ( "-" , "_" ) ; s = s . substring ( 0 , 1 ) . toUpperCase ( ) + s . substring ( 1 ) ; return s ;
public class MethodSimulator { /** * Simulates the size change instruction . * @ param instruction The instruction to simulate */ private void simulateSizeChange ( final SizeChangingInstruction instruction ) { } }
IntStream . range ( 0 , instruction . getNumberOfPops ( ) ) . forEach ( i -> runtimeStack . pop ( ) ) ; IntStream . range ( 0 , instruction . getNumberOfPushes ( ) ) . forEach ( i -> runtimeStack . push ( new Element ( ) ) ) ;
public class Syncer { /** * Gets the indexes of the sync fields into a single integer . * @ param handler the handler * @ param syncNames the sync names * @ return the field indexes */ private int getFieldIndexes ( ISyncHandler < ? , ? extends ISyncableData > handler , String ... syncNames ) { } }
int indexes = 0 ; for ( String str : syncNames ) { ObjectData od = handler . getObjectData ( str ) ; if ( od != null ) indexes |= 1 << od . getIndex ( ) ; } return indexes ;
public class TimeParametersImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case BpsimPackage . TIME_PARAMETERS__TRANSFER_TIME : setTransferTime ( ( Parameter ) null ) ; return ; case BpsimPackage . TIME_PARAMETERS__QUEUE_TIME : setQueueTime ( ( Parameter ) null ) ; return ; case BpsimPackage . TIME_PARAMETERS__WAIT_TIME : setWaitTime ( ( Parameter ) null ) ; return ; ca...
public class StackUtilities { /** * Returns the { @ link StackTraceElement } of the caller . * You should consider use of this method carefully . Unwinding the stack * should be considered an expensive operation . * @ return StackTraceElement of the caller * @ see StackTraceElement */ public static StackTraceEl...
final Thread me = currentThread ( ) ; StackTraceElement [ ] se = me . getStackTrace ( ) ; for ( int i = 0 ; i < se . length ; i ++ ) { String sClass = se [ i ] . getClassName ( ) ; if ( ! sClass . equals ( CLASS ) ) continue ; String method = se [ i ] . getMethodName ( ) ; if ( ! "callerFrame" . equals ( method ) ) con...
public class ThreadUtils { /** * Just suspend the current thread for defined interval in milliseconds . * @ param milliseconds milliseconds to sleep * @ return false if the sleep has been interrupted by InterruptedException , true otherwise . * @ see Thread # sleep ( long ) * @ since 1.0 */ @ Weight ( Weight . ...
boolean result = true ; try { Thread . sleep ( milliseconds ) ; } catch ( InterruptedException ex ) { result = false ; Thread . currentThread ( ) . interrupt ( ) ; } return result ;
public class WDDXConverter { /** * serialize a Object to his xml Format represenation * @ param object Object to serialize * @ param done * @ return serialized Object * @ throws ConverterException */ private String _serialize ( Object object , Set < Object > done ) throws ConverterException { } }
String rtn ; deep ++ ; // NULL if ( object == null ) { rtn = goIn ( ) + "<null/>" ; deep -- ; return rtn ; } // String if ( object instanceof String ) { rtn = goIn ( ) + "<string>" + XMLUtil . escapeXMLString ( object . toString ( ) ) + "</string>" ; deep -- ; return rtn ; } // Number if ( object instanceof Number ) { ...
public class SparseMatrix { /** * Remove item in row , column position int the matrix * @ param row item row position * @ param column item column position */ void remove ( int row , int column ) { } }
SparseArrayCompat < TObj > array = mData . get ( row ) ; if ( array != null ) { array . remove ( column ) ; }
public class DefaultHandlerExceptionManager { /** * { @ inheritDoc } */ @ Override public void handle ( Throwable throwable , Map < String , Object > parameters ) { } }
if ( handlers . size ( ) == 0 ) { register ( Exception . class , new HandlerException ( ) { @ Override public void handle ( Throwable throwable , Map < String , Object > parameters ) { throwable . printStackTrace ( ) ; } } ) ; } if ( throwable != null ) { Class < ? > throwableClass = throwable . getClass ( ) ; while ( ...
public class SystemProperties { /** * Gets a system property boolean , or a replacement value if the property is * null or blank or not parseable as a boolean . * @ param key * @ param valueIfNull * @ return */ public static boolean getBoolean ( String key , boolean valueIfNull ) { } }
String value = System . getProperty ( key ) ; if ( Strings . isNullOrEmpty ( value ) ) { return valueIfNull ; } value = value . trim ( ) . toLowerCase ( ) ; if ( "true" . equals ( value ) ) { return true ; } else if ( "false" . equals ( value ) ) { return false ; } return valueIfNull ;
public class HuffmanTable { /** * build up HuffTab [ t ] [ c ] using L and V . */ private void buildHuffTable ( final int tab [ ] , final int L [ ] , final int V [ ] [ ] ) throws IOException { } }
int temp = 256 ; int k = 0 ; for ( int i = 0 ; i < 8 ; i ++ ) { // i + 1 is Code length for ( int j = 0 ; j < L [ i ] ; j ++ ) { for ( int n = 0 ; n < ( temp >> ( i + 1 ) ) ; n ++ ) { tab [ k ] = V [ i ] [ j ] | ( ( i + 1 ) << 8 ) ; k ++ ; } } } for ( int i = 1 ; k < 256 ; i ++ , k ++ ) { tab [ k ] = i | MSB ; } int cu...
public class CmsElementView { /** * Returns the element view title . < p > * @ param cms the cms context * @ param locale the locale * @ return the title */ public String getTitle ( CmsObject cms , Locale locale ) { } }
if ( m_titleKey == null ) { return m_title ; } else { return OpenCms . getWorkplaceManager ( ) . getMessages ( locale ) . key ( m_titleKey ) ; }
public class CharOperation { /** * Answers a new array which is a copy of the given array starting at the given start and ending at the given end . * The given start is inclusive and the given end is exclusive . Answers null if start is greater than end , if start * is lower than 0 or if end is greater than the len...
if ( end == - 1 ) { end = array . length ; } if ( start > end ) { return null ; } if ( start < 0 ) { return null ; } if ( end > array . length ) { return null ; } char [ ] [ ] result = new char [ end - start ] [ ] ; System . arraycopy ( array , start , result , 0 , end - start ) ; return result ;
public class EncodingResult { /** * Adds a clause to the result * @ param literals the literals of the clause */ public void addClause ( final Literal ... literals ) { } }
if ( this . miniSat == null && this . cleaneLing == null ) this . result . add ( this . f . clause ( literals ) ) ; else if ( this . miniSat != null ) { final LNGIntVector clauseVec = new LNGIntVector ( literals . length ) ; for ( final Literal lit : literals ) { int index = this . miniSat . underlyingSolver ( ) . idxF...
public class TransferManager { /** * Resumes an upload operation . This upload operation uses the same * configuration { @ link TransferManagerConfiguration } as the original * upload . Any data already uploaded will be skipped , and only the remaining * will be uploaded to Amazon S3. * @ param persistableUploa...
assertParameterNotNull ( persistableUpload , "PauseUpload is mandatory to resume a upload." ) ; configuration . setMinimumUploadPartSize ( persistableUpload . getPartSize ( ) ) ; configuration . setMultipartUploadThreshold ( persistableUpload . getMutlipartUploadThreshold ( ) ) ; return doUpload ( new PutObjectRequest ...
public class OrCriterion { @ Override public List < Criterion > getCriteria ( ) { } }
if ( criteria == null ) { criteria = new ArrayList < Criterion > ( ) ; } return criteria ;
public class Toothpick { /** * Detach a scope from its parent , this will trigger the garbage collection of this scope and it ' s * sub - scopes * if they are not referenced outside of Toothpick . * @ param name the name of the scope to close . */ public static void closeScope ( Object name ) { } }
// we remove the scope first , so that other threads don ' t see it , and see the next snapshot of the tree ScopeNode scope = ( ScopeNode ) MAP_KEY_TO_SCOPE . remove ( name ) ; if ( scope != null ) { ScopeNode parentScope = scope . getParentScope ( ) ; if ( parentScope != null ) { parentScope . removeChild ( scope ) ; ...
public class XmlFieldExtractor { /** * Runs a wildcard xpath ( i . e . " / / field " ) to locate the provided field in the * document and returns the text content of the first matching node . * @ param doc Document to process . * @ param field Field to look for . * @ return Text content of first matching node o...
XPathExpression expr = xpathSupplier . get ( ) . compile ( "//" + field ) ; NodeList nl = ( NodeList ) expr . evaluate ( doc , XPathConstants . NODESET ) ; if ( nl . getLength ( ) > 0 ) { return nl . item ( 0 ) . getTextContent ( ) ; } return null ;
public class Bzip2BlockDecompressor { /** * Reads the Huffman encoded data from the input stream , performs Run - Length Decoding and * applies the Move To Front transform to reconstruct the Burrows - Wheeler Transform array . */ boolean decodeHuffmanData ( final Bzip2HuffmanStageDecoder huffmanDecoder ) { } }
final Bzip2BitReader reader = this . reader ; final byte [ ] bwtBlock = this . bwtBlock ; final byte [ ] huffmanSymbolMap = this . huffmanSymbolMap ; final int streamBlockSize = this . bwtBlock . length ; final int huffmanEndOfBlockSymbol = this . huffmanEndOfBlockSymbol ; final int [ ] bwtByteCounts = this . bwtByteCo...
public class BitsStreamGenerator { /** * Returns a pseudorandom , uniformly distributed < tt > long < / tt > value * between 0 ( inclusive ) and the specified value ( exclusive ) , drawn from * this random number generator ' s sequence . * @ param n the bound on the random number to be returned . Must be * posi...
if ( n > 0 ) { long bits ; long val ; do { bits = ( ( long ) next ( 31 ) ) << 32 ; bits = bits | ( ( ( long ) next ( 32 ) ) & 0xffffffffL ) ; val = bits % n ; } while ( bits - val + ( n - 1 ) < 0 ) ; return val ; } throw new RuntimeException ( "Not strictly positive: " + n ) ;
public class ListIPSetsResult { /** * An array of < a > IPSetSummary < / a > objects . * @ param iPSets * An array of < a > IPSetSummary < / a > objects . */ public void setIPSets ( java . util . Collection < IPSetSummary > iPSets ) { } }
if ( iPSets == null ) { this . iPSets = null ; return ; } this . iPSets = new java . util . ArrayList < IPSetSummary > ( iPSets ) ;
public class HiveMetaStoreBridge { /** * Create a new table instance in Atlas * @ param dbReference reference to a created Hive database { @ link Referenceable } to which this table belongs * @ param hiveTable reference to the Hive { @ link Table } from which to map properties * @ return Newly created Hive refere...
return createOrUpdateTableInstance ( dbReference , null , hiveTable ) ;
public class AbstractTemporalCellConverterFactory { /** * アノテーションを元にフォーマッタを作成する 。 * @ param converterAnno 変換用のアノテーション 。 * @ return フォーマッタ */ protected DateTimeFormatter createFormatter ( final Optional < XlsDateTimeConverter > converterAnno ) { } }
final boolean lenient = converterAnno . map ( a -> a . lenient ( ) ) . orElse ( false ) ; final ResolverStyle style = lenient ? ResolverStyle . LENIENT : ResolverStyle . STRICT ; if ( ! converterAnno . isPresent ( ) ) { return DateTimeFormatter . ofPattern ( getDefaultJavaPattern ( ) ) . withResolverStyle ( style ) ; }...
public class SarlSkillBuilderImpl { /** * Create a SarlConstructor . * @ return the builder . */ public ISarlConstructorBuilder addSarlConstructor ( ) { } }
ISarlConstructorBuilder builder = this . iSarlConstructorBuilderProvider . get ( ) ; builder . eInit ( getSarlSkill ( ) , getTypeResolutionContext ( ) ) ; return builder ;
public class JarURLConnectionImpl { /** * Returns the content length of the resource . Test cases reveal that if the URL is referring to * a Jar file , this method answers a content - length returned by URLConnection . For a jar entry * it returns the entry ' s size if it can be represented as an { @ code int } . O...
try { connect ( ) ; if ( jarEntry == null ) { return jarFileURLConnection . getContentLength ( ) ; } return ( int ) getJarEntry ( ) . getSize ( ) ; } catch ( IOException e ) { // Ignored } return - 1 ;
public class Application { /** * < p > readModeConfig . < / p > * @ param properties a { @ link java . util . Properties } object . * @ param mode a { @ link ameba . core . Application . Mode } object . */ @ SuppressWarnings ( "unchecked" ) public static void readModeConfig ( Properties properties , Mode mode ) { }...
// 读取相应模式的配置文件 Enumeration < java . net . URL > confs = IOUtils . getResources ( "conf/" + mode . name ( ) . toLowerCase ( ) + ".conf" ) ; while ( confs . hasMoreElements ( ) ) { InputStream in = null ; try { URLConnection connection = confs . nextElement ( ) . openConnection ( ) ; if ( mode . isDev ( ) ) { connection ...
public class AbstractAttributeDefinitionBuilder { /** * Adds { @ link AttributeDefinition # getArbitraryDescriptors ( ) arbitrary descriptor } . * @ param arbitraryDescriptor the arbitrary descriptor name . * @ param value the value of the arbitrary descriptor . * @ return a builder that can be used to continue b...
if ( this . arbitraryDescriptors == null ) { this . arbitraryDescriptors = Collections . singletonMap ( arbitraryDescriptor , value ) ; } else { if ( this . arbitraryDescriptors . size ( ) == 1 ) { this . arbitraryDescriptors = new HashMap < > ( this . arbitraryDescriptors ) ; } arbitraryDescriptors . put ( arbitraryDe...
public class StorageType { /** * List of limits that are applicable for given storage type . * @ param storageTypeLimits * List of limits that are applicable for given storage type . */ public void setStorageTypeLimits ( java . util . Collection < StorageTypeLimit > storageTypeLimits ) { } }
if ( storageTypeLimits == null ) { this . storageTypeLimits = null ; return ; } this . storageTypeLimits = new java . util . ArrayList < StorageTypeLimit > ( storageTypeLimits ) ;
public class SecretShare { /** * NOTE : you should prefer createAppropriateModulusForSecret ( ) over this method . * @ param secret as biginteger * @ return prime modulus big enough for secret */ public static BigInteger createRandomModulusForSecret ( BigInteger secret ) { } }
Random random = new SecureRandom ( ) ; return createRandomModulusForSecret ( secret , random ) ;
public class Node { /** * Provides lookup of elements by non - namespaced name * @ param key the name ( or shortcut key ) of the node ( s ) of interest * @ return the nodes which match key */ public Object get ( String key ) { } }
if ( key != null && key . charAt ( 0 ) == '@' ) { String attributeName = key . substring ( 1 ) ; return attributes ( ) . get ( attributeName ) ; } if ( ".." . equals ( key ) ) { return parent ( ) ; } if ( "*" . equals ( key ) ) { return children ( ) ; } if ( "**" . equals ( key ) ) { return depthFirst ( ) ; } return ge...
public class TemplateNode { /** * Construct a StackTraceElement that will point to the given source location of the current * template . */ public StackTraceElement createStackTraceElement ( SourceLocation srcLocation ) { } }
return new StackTraceElement ( /* declaringClass = */ soyFileHeaderInfo . namespace , // The partial template name begins with a ' . ' that causes the stack trace element to // print " namespace . . templateName " otherwise . /* methodName = */ partialTemplateName . substring ( 1 ) , srcLocation . getFileName ( ) , src...
public class Properties { /** * Calculates value of the property corresponding to cmis domain . * @ param pdef property definition as declared in cmis repository . * @ param jcrName the name of the property in jcr domain * @ param document connectors ' s view of properties in jcr domain . * @ return value as de...
switch ( pdef . getPropertyType ( ) ) { case STRING : return document . getString ( jcrName ) ; case BOOLEAN : return document . getBoolean ( jcrName ) ; case DECIMAL : return BigDecimal . valueOf ( document . getLong ( jcrName ) ) ; case INTEGER : return document . getInteger ( jcrName ) ; case DATETIME : // FIXME ret...
public class TeamDataClient { /** * Removes scope - owners ( teams ) from the collection which have went to an * non - active state * @ param teamId * A given Team ID that went inactive and should be removed from * the data collection */ private void removeInactiveScopeOwnerByTeamId ( String teamId ) { } }
if ( ! StringUtils . isEmpty ( teamId ) && teamRepo . findByTeamId ( teamId ) != null ) { ObjectId inactiveTeamId = teamRepo . findByTeamId ( teamId ) . getId ( ) ; if ( inactiveTeamId != null ) { teamRepo . delete ( inactiveTeamId ) ; } }
public class AggregatorExtension { /** * / * ( non - Javadoc ) * @ see com . ibm . jaggr . service . IAggregator . ILoadedExtension # getAttribute ( java . lang . String ) */ @ Override public String getAttribute ( String name ) { } }
final String sourceMethod = "getAttribute" ; // $ NON - NLS - 1 $ boolean isTraceLogging = log . isLoggable ( Level . FINER ) ; if ( isTraceLogging ) { log . entering ( AggregatorExtension . class . getName ( ) , sourceMethod , new Object [ ] { name } ) ; } String result = attributes . getProperty ( name ) ; if ( resul...
public class HistoryStore { /** * Return a fresh map */ private JSONObject addAttributeFromSingleValue ( HistoryKey pKey , String pAttrName , Object pValue , long pTimestamp ) { } }
HistoryEntry entry = getEntry ( pKey , pValue , pTimestamp ) ; return entry != null ? addToHistoryEntryAndGetCurrentHistory ( new JSONObject ( ) , entry , pAttrName , pValue , pTimestamp ) : null ;
public class SimpleMimeTypeDetector { /** * Return { @ code true } if { @ code bytes } looks like a beginning of a * binary file . * < p > Looks for well - known binary format MAGICs . < / p > * @ param bytes array of bytes . * @ return detected mimetype , or { @ code null } if no binary * format is detected ...
// NB : there are a lot of specific mimetypes we can detect by file // magic , but we don ' t want to make too much effort here . // " application / octet - stream " is fine if file looks very much like // binary but don ' t know what exactly . Returned value is not really // used beyond being non - null . We ' re only...
public class GrailsWebRequest { /** * Returns the context path of the request . * @ return the path */ @ Override public String getContextPath ( ) { } }
final HttpServletRequest request = getCurrentRequest ( ) ; String appUri = ( String ) request . getAttribute ( GrailsApplicationAttributes . APP_URI_ATTRIBUTE ) ; if ( appUri == null ) { appUri = urlHelper . getContextPath ( request ) ; } return appUri ;
public class TrecEvalParser { /** * A method that parses a line from the file . * @ param line the line to be parsed * @ param dataset the dataset where the information parsed from the line * will be stored into . */ private void parseLine ( final String line , final DataModelIF < Long , Long > dataset ) { } }
String [ ] toks = line . split ( "\t" ) ; // user long userId = Long . parseLong ( toks [ USER_TOK ] ) ; // item long itemId = Long . parseLong ( toks [ ITEM_TOK ] ) ; // preference double preference = Double . parseDouble ( toks [ RATING_TOK ] ) ; // update information dataset . addPreference ( userId , itemId , prefe...
public class CglibLazyInitializer { /** * Gets the proxy factory . * @ param persistentClass * the persistent class * @ param interfaces * the interfaces * @ return the proxy factory * @ throws PersistenceException * the persistence exception */ public static Class getProxyFactory ( Class persistentClass ...
Enhancer e = new Enhancer ( ) ; e . setSuperclass ( interfaces . length == 1 ? persistentClass : null ) ; e . setInterfaces ( interfaces ) ; e . setCallbackTypes ( new Class [ ] { InvocationHandler . class , NoOp . class , } ) ; e . setCallbackFilter ( FINALIZE_FILTER ) ; e . setUseFactory ( false ) ; e . setInterceptD...
public class SQLStore { /** * { @ inheritDoc } */ @ Override public void onCreate ( SQLiteDatabase db ) { } }
db . execSQL ( String . format ( CREATE_PROPERTIES_TABLE , className ) ) ; db . execSQL ( String . format ( CREATE_PROPERTIES_INDEXES , className , className , className , className , className , className ) ) ;
public class SqlQuery { /** * { @ inheritDoc } */ public SqlQuery params ( Map < String , Object > newParams ) { } }
this . params = CollectUtils . newHashMap ( newParams ) ; return this ;
public class UrlPatternAnalyzer { protected void assertEndBraceExists ( Method executeMethod , String urlPattern , int index ) { } }
if ( index >= 0 ) { throwUrlPatternEndBraceNotFoundException ( executeMethod , urlPattern , index ) ; }
public class ModelResource { /** * { @ inheritDoc } * find model history between start to end timestamp versions * need model mark { @ code @ History } */ @ GET @ Path ( "{id}/history/{start: " + DATE_REGEX + "}-{end: " + DATE_REGEX + "}" ) public Response fetchHistory ( @ PathParam ( "id" ) URI_ID id , @ PathParam...
return super . fetchHistory ( id , start , end ) ;