signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class TangoAttribute { /** * Extract data and format it as followed : \ n SCALAR : ex : 1 SPECTRUM : one * line separated by separator . \ n ex : 1 3 5 IMAGE : x lines and y colums * separated by endSeparator . \ n ex : 3 5 8 5 6 9 * @ param separator * @ param endSeparator * @ return * @ throws DevF...
logger . debug ( LOG_EXTRACTING , this ) ; return attributeImpl . extractToString ( separator , endSeparator ) ;
public class ApplicationHostService { /** * Returns the set of application hosts with the given query parameters . * @ param applicationId The application id * @ param queryParams The query parameters * @ return The set of application hosts */ public Collection < ApplicationHost > list ( long applicationId , List...
return HTTP . GET ( String . format ( "/v2/applications/%d/hosts.json" , applicationId ) , null , queryParams , APPLICATION_HOSTS ) . get ( ) ;
public class RRBudget10V1_3Generator { /** * This method gets BudgetYearDataType details like * BudgetPeriodStartDate , BudgetPeriodEndDate , BudgetPeriod * KeyPersons , OtherPersonnel , TotalCompensation , Equipment , ParticipantTraineeSupportCosts , Travel , OtherDirectCosts * DirectCosts , IndirectCosts , Cogn...
BudgetYearDataType budgetYear = rrBudget . addNewBudgetYear ( ) ; if ( periodInfo != null ) { budgetYear . setBudgetPeriodStartDate ( s2SDateTimeService . convertDateToCalendar ( periodInfo . getStartDate ( ) ) ) ; budgetYear . setBudgetPeriodEndDate ( s2SDateTimeService . convertDateToCalendar ( periodInfo . getEndDat...
public class AmazonEC2Waiters { /** * Builds a VolumeInUse waiter by using custom parameters waiterParameters and other parameters defined in the * waiters specification , and then polls until it determines whether the resource entered the desired state or not , * where polling criteria is bound by either default p...
return new WaiterBuilder < DescribeVolumesRequest , DescribeVolumesResult > ( ) . withSdkFunction ( new DescribeVolumesFunction ( client ) ) . withAcceptors ( new VolumeInUse . IsInuseMatcher ( ) , new VolumeInUse . IsDeletedMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy...
public class RecurlyClient { /** * Lookup all coupon redemptions on an invoice given query params . * @ deprecated Prefer using Invoice # getId ( ) as the id param ( which is a String ) * @ param invoiceNumber invoice number * @ param params { @ link QueryParams } * @ return the coupon redemptions for this invo...
return getCouponRedemptionsByInvoice ( invoiceNumber . toString ( ) , params ) ;
public class RegExpImpl { /** * Used by js _ split to find the next split point in target , * starting at offset ip and looking either for the given * separator substring , or for the next re match . ip and * matchlen must be reference variables ( assumed to be arrays of * length 1 ) so they can be updated in t...
int i = ip [ 0 ] ; int length = target . length ( ) ; /* * Perl4 special case for str . split ( ' ' ) , only if the user has selected * JavaScript1.2 explicitly . Split on whitespace , and skip leading w / s . * Strange but true , apparently modeled after awk . */ if ( version == Context . VERSION_1_2 && re == null...
public class MolecularFormulaManipulator { /** * Checks a set of Nodes for the occurrence of the isotopes in the * molecular formula from a particular IElement . It returns 0 if the * element does not exist . The search is based only on the IElement . * @ param formula The MolecularFormula to check * @ param el...
int count = 0 ; for ( IIsotope isotope : formula . isotopes ( ) ) { if ( isotope . getSymbol ( ) . equals ( element . getSymbol ( ) ) ) count += formula . getIsotopeCount ( isotope ) ; } return count ;
public class F4 { /** * Applies this partial function to the given argument when it is contained in the function domain . * Applies fallback function where this partial function is not defined . * @ param p1 * the first argument * @ param p2 * the second argument * @ param p3 * the third argument * @ pa...
try { return apply ( p1 , p2 , p3 , p4 ) ; } catch ( RuntimeException e ) { return fallback . apply ( p1 , p2 , p3 , p4 ) ; }
public class OffHeapCache { /** * TODO : performance tuning for concurrent put . */ private AvaialbeSegment getAvailableSegment ( int size ) { } }
Deque < Segment > queue = null ; int blockSize = 0 ; if ( size <= 256 ) { queue = _queue256 ; blockSize = 256 ; } else if ( size <= 384 ) { queue = _queue384 ; blockSize = 384 ; } else if ( size <= 512 ) { queue = _queue512 ; blockSize = 512 ; } else if ( size <= 640 ) { queue = _queue640 ; blockSize = 640 ; } else if ...
public class NNLatencyBenchmark { /** * Sets up clients before each benchmark */ private void setUp ( ) throws Exception { } }
try { fileSystem = ( DistributedFileSystem ) FileSystem . get ( StorageServiceConfigKeys . translateToOldSchema ( conf , nameserviceId ) , conf ) ; InetSocketAddress nameNodeAddr = fileSystem . getClient ( ) . getNameNodeAddr ( ) ; metaInfo = new RequestMetaInfo ( clusterId , nameserviceId , RequestMetaInfo . NO_NAMESP...
public class JavaParser { /** * src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 1187:1 : additiveExpression : multiplicativeExpression ( ( ' + ' | ' - ' ) multiplicativeExpression ) * ; */ public final void additiveExpression ( ) throws RecognitionException { } }
int additiveExpression_StartIndex = input . index ( ) ; try { if ( state . backtracking > 0 && alreadyParsedRule ( input , 122 ) ) { return ; } // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 1188:5 : ( multiplicativeExpression ( ( ' + ' | ' - ' ) multiplicativeExpression ) ...
public class OracleHelper { /** * < p > This method is used to reset a connection before it is returned to the connection pool for reuse . * This method is called only if at least one of the following Oracle connection setter methods is invoked . < / p > * < ul > * < li > setDefaultExecuteBatch * < li > setDefa...
try { Class < ? > c = OracleConnection . get ( ) ; if ( c == null ) OracleConnection . set ( c = WSManagedConnectionFactoryImpl . priv . loadClass ( mcf . jdbcDriverLoader , oracle_jdbc_OracleConnection ) ) ; Method m ; m = setDefaultExecuteBatch . get ( ) ; if ( m == null ) setDefaultExecuteBatch . set ( m = c . getMe...
public class WampSession { /** * Expose the object to synchronize on for the underlying session . * @ return the session mutex to use ( never { @ code null } ) */ public Object getSessionMutex ( ) { } }
Object mutex = getAttribute ( SESSION_MUTEX_NAME ) ; if ( mutex == null ) { mutex = this . webSocketSession . getAttributes ( ) ; } return mutex ;
public class BindingValidator { /** * Validate if the { @ code configurationBean } object was bound successfully * @ param configurationBean configurationBean to validate * @ param type interface used to access { @ code configurationBean } * @ param < T > type of the validated bean * @ throws IllegalStateExcept...
LOG . debug ( "Validating configuration bean of type " + type ) ; for ( Method declaredMethod : type . getDeclaredMethods ( ) ) { try { LOG . debug ( "Validating method: " + declaredMethod . getName ( ) ) ; declaredMethod . invoke ( configurationBean ) ; } catch ( InvocationTargetException e ) { if ( e . getCause ( ) !...
public class ApplicationProperties { /** * Get the specified property as an { @ link InputStream } . * If the property is not set , then the specified default filename * is searched for in the following locations , in order of precedence : * 1 . Atlas configuration directory specified by the { @ link # ATLAS _ CO...
File fileToLoad = null ; String fileName = configuration . getString ( propertyName ) ; if ( fileName == null ) { if ( defaultFileName == null ) { throw new AtlasException ( propertyName + " property not set and no default value specified" ) ; } fileName = defaultFileName ; String atlasConfDir = System . getProperty ( ...
public class SemanticSearchServiceImpl { /** * A helper function to create a list of queryTerms based on the information from the * targetAttribute as well as user defined searchTerms . If the user defined searchTerms exist , the * targetAttribute information will not be used . * @ return list of queryTerms */ pu...
Set < String > queryTerms = new HashSet < > ( ) ; if ( searchTerms != null && ! searchTerms . isEmpty ( ) ) { queryTerms . addAll ( searchTerms ) ; } if ( queryTerms . isEmpty ( ) ) { if ( StringUtils . isNotBlank ( targetAttribute . getLabel ( ) ) ) { queryTerms . add ( targetAttribute . getLabel ( ) ) ; } if ( String...
public class ConstrainableInputStream { /** * Reads this inputstream to a ByteBuffer . The supplied max may be less than the inputstream ' s max , to support * reading just the first bytes . */ public ByteBuffer readToByteBuffer ( int max ) throws IOException { } }
Validate . isTrue ( max >= 0 , "maxSize must be 0 (unlimited) or larger" ) ; final boolean localCapped = max > 0 ; // still possibly capped in total stream final int bufferSize = localCapped && max < DefaultSize ? max : DefaultSize ; final byte [ ] readBuffer = new byte [ bufferSize ] ; final ByteArrayOutputStream outS...
public class JapaneseEra { /** * Obtains an instance of { @ code JapaneseEra } from a date . * @ param date the date , not null * @ return the Era singleton , never null */ static JapaneseEra from ( LocalDate date ) { } }
if ( date . isBefore ( MEIJI . since ) ) { throw new DateTimeException ( "Date too early: " + date ) ; } JapaneseEra [ ] known = KNOWN_ERAS . get ( ) ; for ( int i = known . length - 1 ; i >= 0 ; i -- ) { JapaneseEra era = known [ i ] ; if ( date . compareTo ( era . since ) >= 0 ) { return era ; } } return null ;
public class ZMatrixTools { /** * Takes the given Z Matrix coordinates and converts them to cartesian coordinates . * The first Atom end up in the origin , the second on on the x axis , and the third * one in the XY plane . The rest is added by applying the Zmatrix distances , angles * and dihedrals . Angles are ...
Point3d [ ] cartesianCoords = new Point3d [ distances . length ] ; for ( int index = 0 ; index < distances . length ; index ++ ) { if ( index == 0 ) { cartesianCoords [ index ] = new Point3d ( 0d , 0d , 0d ) ; } else if ( index == 1 ) { cartesianCoords [ index ] = new Point3d ( distances [ 1 ] , 0d , 0d ) ; } else if (...
public class User { /** * Lazy loader for getting the context to which this user corresponds . * @ return the context */ public Context getContext ( ) { } }
if ( context == null ) { context = Model . getSingleton ( ) . getSession ( ) . getContext ( this . contextId ) ; } return context ;
public class ToStream { /** * Begin the scope of a prefix - URI Namespace mapping * just before another element is about to start . * This call will close any open tags so that the prefix mapping * will not apply to the current element , but the up comming child . * @ see org . xml . sax . ContentHandler # star...
// the " true " causes the flush of any open tags startPrefixMapping ( prefix , uri , true ) ;
public class SnapshotDaemon { /** * Process responses to sysproc invocations generated by this daemon * via processPeriodicWork * @ param response * @ return */ public Future < Void > processClientResponse ( final Callable < ClientResponseImpl > response ) { } }
return m_es . submit ( new Callable < Void > ( ) { @ Override public Void call ( ) throws Exception { try { ClientResponseImpl resp = response . call ( ) ; long handle = resp . getClientHandle ( ) ; m_procedureCallbacks . remove ( handle ) . clientCallback ( resp ) ; } catch ( Exception e ) { SNAP_LOG . warn ( "Error w...
public class BeanWrapperUtils { /** * Get the whole list of read { @ link Method } s using introspection . * @ param bean * the bean to introspect * @ return the map of bean property getters ( indexed by property name ) */ public static Map < String , Method > getReadMethods ( Object bean ) { } }
Class < ? extends Object > beanClass = bean . getClass ( ) ; try { Map < String , Method > readMethods = new HashMap < > ( ) ; final BeanInfo beanInfo = Introspector . getBeanInfo ( beanClass ) ; final PropertyDescriptor [ ] propertyDescriptors = beanInfo . getPropertyDescriptors ( ) ; if ( propertyDescriptors != null ...
public class EidPreconditions { /** * Ensures that { @ code index } specifies a valid < i > element < / i > in an array , * list or string of size { @ code size } . An element index may range from * zero , inclusive , to { @ code size } , exclusive . * Please , note that for performance reasons , Eid is not evalu...
if ( isSizeIllegal ( size ) ) { throw new EidIllegalArgumentException ( ensureEid ( eid ) ) ; } if ( isIndexAndSizeIllegal ( index , size ) ) { throw new EidIndexOutOfBoundsException ( ensureEid ( eid ) ) ; } return index ;
public class OTMJCAManagedConnection { /** * Section 6.5.6 of the JCA 1.5 spec instructs ManagedConnection instances to notify connection listeners with * close / error and local transaction - related events to its registered set of listeners . * The events for begin / commit / rollback are only sent if the applica...
ConnectionEvent ce = null ; if ( ex == null ) { ce = new ConnectionEvent ( this , eventType ) ; } else { ce = new ConnectionEvent ( this , eventType , ex ) ; } ce . setConnectionHandle ( connectionHandle ) ; Collection copy = null ; synchronized ( m_connectionEventListeners ) { copy = new ArrayList ( m_connectionEventL...
public class XNodeSet { /** * Cast result object to a number , but allow side effects , such as the * incrementing of an iterator . * @ return numeric value of the string conversion from the * next node in the NodeSetDTM , or NAN if no node was found */ public double numWithSideEffects ( ) { } }
int node = nextNode ( ) ; return ( node != DTM . NULL ) ? getNumberFromNode ( node ) : Double . NaN ;
public class SubscriptionDefinitionVersionMarshaller { /** * Marshall the given parameter object . */ public void marshall ( SubscriptionDefinitionVersion subscriptionDefinitionVersion , ProtocolMarshaller protocolMarshaller ) { } }
if ( subscriptionDefinitionVersion == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( subscriptionDefinitionVersion . getSubscriptions ( ) , SUBSCRIPTIONS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marsha...
public class AlwaysSampleSampler { /** * Returns always makes a " yes " decision on { @ link Span } sampling . */ @ Override public boolean shouldSample ( @ Nullable SpanContext parentContext , @ Nullable Boolean hasRemoteParent , TraceId traceId , SpanId spanId , String name , List < Span > parentLinks ) { } }
return true ;
public class AmazonLightsailClient { /** * Returns information about a specific database in Amazon Lightsail . * @ param getRelationalDatabaseRequest * @ return Result of the GetRelationalDatabase operation returned by the service . * @ throws ServiceException * A general service exception . * @ throws Invali...
request = beforeClientExecution ( request ) ; return executeGetRelationalDatabase ( request ) ;
public class EmailIntentBuilder { /** * Set the subject line for this email intent . * @ param subject * the email subject line * @ return This { @ code EmailIntentBuilder } for method chaining */ @ NonNull public EmailIntentBuilder subject ( @ NonNull String subject ) { } }
checkNotNull ( subject ) ; checkNoLineBreaks ( subject ) ; this . subject = subject ; return this ;
public class WorkerHeartbeatRunable { /** * do heartbeat and update LocalState */ public void doHeartbeat ( ) throws IOException { } }
int curTime = TimeUtils . current_time_secs ( ) ; WorkerHeartbeat hb = new WorkerHeartbeat ( curTime , topologyId , taskIds , port ) ; LOG . debug ( "Doing heartbeat:" + workerId + ",port:" + port + ",hb" + hb . toString ( ) ) ; LocalState state = getWorkerState ( ) ; state . put ( Common . LS_WORKER_HEARTBEAT , hb ) ;
public class FromElementsFunction { @ Override public void snapshotState ( FunctionSnapshotContext context ) throws Exception { } }
Preconditions . checkState ( this . checkpointedState != null , "The " + getClass ( ) . getSimpleName ( ) + " has not been properly initialized." ) ; this . checkpointedState . clear ( ) ; this . checkpointedState . add ( this . numElementsEmitted ) ;
public class JsonUtil { /** * Create a JCR value from string value for the designated JCR type . * @ param node the node of the property * @ param type the JCR type according to the types declared in PropertyType * @ param object the value in the right type or a string representation of the value , * for binary...
Session session = node . getSession ( ) ; ValueFactory factory = session . getValueFactory ( ) ; Value value = null ; if ( object != null ) { switch ( type ) { case PropertyType . BINARY : if ( mapping . propertyFormat . binary != MappingRules . PropertyFormat . Binary . skip ) { InputStream input = null ; if ( object ...
public class DocumentTable { /** * { @ inheritDoc } */ @ Override protected void _to ( ObjectOutput out ) throws IOException { } }
// 1 : write the number of document headers out . writeInt ( headers . size ( ) ) ; for ( DocumentHeader header : headers ) { // 1 : write each document header header . writeExternal ( out ) ; }
public class InterproceduralCallGraph { /** * ( non - Javadoc ) * @ see * edu . umd . cs . findbugs . graph . AbstractGraph # allocateEdge ( edu . umd . cs . findbugs * . graph . AbstractVertex , edu . umd . cs . findbugs . graph . AbstractVertex ) */ @ Override protected InterproceduralCallGraphEdge allocateEdge...
return new InterproceduralCallGraphEdge ( source , target ) ;
public class AbstractCentralDogmaBuilder { /** * Adds the { @ link URI } of the Central Dogma server . * @ deprecated Use { @ link # host ( String ) } or { @ link # profile ( String . . . ) } . * @ param uri the URI of the Central Dogma server . e . g . * { @ code tbinary + http : / / example . com : 36462 / cd /...
final URI parsed = URI . create ( requireNonNull ( uri , "uri" ) ) ; final String host = parsed . getHost ( ) ; final int port = parsed . getPort ( ) ; checkArgument ( host != null , "uri: %s (must contain a host part)" , uri ) ; if ( port < 0 ) { host ( host ) ; } else { host ( host , port ) ; } return self ( ) ;
public class ErrorHandling { /** * This method will return the first < code > ErrorReporter < / code > in the parental chain of the * tag . Searching starts with this tag . * @ return an < code > ErrorReporter < / code > if one is found in the parental chain , otherwise null . */ private static IErrorReporter getEr...
if ( tag instanceof IErrorReporter && ( ( IErrorReporter ) tag ) . isReporting ( ) ) return ( IErrorReporter ) tag ; // check to see if this tag has is an ErrorReporter or has an ErrorReporter as a parent IErrorReporter er = ( IErrorReporter ) SimpleTagSupport . findAncestorWithClass ( tag , IErrorReporter . class ) ; ...
public class EntityUtilities { /** * Checks to see if a Content Spec Meta Data element has changed . * @ param metaDataName The Content Spec Meta Data name . * @ param currentValue The expected current value of the Meta Data node . * @ param contentSpecEntity The Content Spec Entity to check against . * @ retur...
final CSNodeWrapper metaData = contentSpecEntity . getMetaData ( metaDataName ) ; if ( metaData != null && metaData . getAdditionalText ( ) != null && ! metaData . getAdditionalText ( ) . equals ( currentValue ) ) { // The values no longer match return true ; } else if ( ( metaData == null || metaData . getAdditionalTe...
public class Writer { /** * Configure the name of the sheet to be written . The default is Sheet0. * @ param sheetName sheet name * @ return Writer */ public Writer sheet ( String sheetName ) { } }
if ( StringUtil . isEmpty ( sheetName ) ) { throw new IllegalArgumentException ( "sheet cannot be empty" ) ; } this . sheetName = sheetName ; return this ;
public class HttpUtil { /** * 从请求参数的body中判断请求的Content - Type类型 , 支持的类型有 : * < pre > * 1 . application / json * 1 . application / xml * < / pre > * @ param body 请求参数体 * @ return Content - Type类型 , 如果无法判断返回null * @ since 3.2.0 * @ see ContentType # get ( String ) */ public static String getContentTypeByRe...
final ContentType contentType = ContentType . get ( body ) ; return ( null == contentType ) ? null : contentType . toString ( ) ;
public class MutableDocument { /** * Set an Array value for the given key * @ param key the key . * @ param key the Array value . * @ return this MutableDocument instance */ @ NonNull @ Override public MutableDocument setArray ( @ NonNull String key , Array value ) { } }
return setValue ( key , value ) ;
public class ToFachwertSerializer { /** * Fuer die Serialisierung wird der uebergebenen Fachwert nach seinen * einzelnen Elementen aufgeteilt und serialisiert . * @ param fachwert Fachwert * @ param jgen Json - Generator * @ param provider Provider * @ throws IOException sollte nicht auftreten */ @ Override p...
serialize ( fachwert . toMap ( ) , jgen , provider ) ;
public class MetaService { /** * { @ inheritDoc } */ @ Override public void write ( IMetaData < ? , ? > meta ) throws IOException { } }
// Get cue points , FLV reader and writer IMetaCue [ ] metaArr = meta . getMetaCue ( ) ; FLVReader reader = new FLVReader ( file , false ) ; FLVWriter writer = new FLVWriter ( file , false ) ; ITag tag = null ; // Read first tag if ( reader . hasMoreTags ( ) ) { tag = reader . readTag ( ) ; if ( tag . getDataType ( ) =...
public class CmsSitemapDNDController { /** * Handles a dropped detail page . < p > * @ param createItem the detail page which was dropped into the sitemap * @ param parent the parent sitemap entry */ private void handleDropNewEntry ( CmsCreatableListItem createItem , final CmsClientSitemapEntry parent ) { } }
final CmsNewResourceInfo typeInfo = createItem . getResourceTypeInfo ( ) ; final CmsClientSitemapEntry entry = new CmsClientSitemapEntry ( ) ; entry . setNew ( true ) ; entry . setVfsPath ( null ) ; entry . setPosition ( m_insertIndex ) ; entry . setInNavigation ( true ) ; Map < String , CmsClientProperty > defaultFile...
public class StorageDescriptor { /** * A list of reducer grouping columns , clustering columns , and bucketing columns in the table . * @ param bucketColumns * A list of reducer grouping columns , clustering columns , and bucketing columns in the table . */ public void setBucketColumns ( java . util . Collection < ...
if ( bucketColumns == null ) { this . bucketColumns = null ; return ; } this . bucketColumns = new java . util . ArrayList < String > ( bucketColumns ) ;
public class InjectionFuture { /** * < p > create . < / p > * @ param type a { @ link java . lang . Class } object . * @ param locator a { @ link org . ops4j . pax . wicket . spi . ProxyTargetLocator } object . * @ param < T > a T object . * @ return a { @ link org . ops4j . pax . wicket . internal . injection ...
return new InjectionFuture < T > ( type , locator ) ;
public class EvaluationCalibration { /** * Get the residual plot for all classes combined . The residual plot is defined as a histogram of < br > * | label _ i - prob ( class _ i | input ) | for all classes i and examples . < br > * In general , small residuals indicate a superior classifier to large residuals . ...
String title = "Residual Plot - All Predictions and Classes" ; int [ ] counts = residualPlotOverall . data ( ) . asInt ( ) ; return new Histogram ( title , 0.0 , 1.0 , counts ) ;
public class Sharded { /** * A key tag is a special pattern inside a key that , if preset , is the only part of the key hashed * in order to select the server for this key . * @ see < a href = " http : / / redis . io / topics / partitioning " > partitioning < / a > * @ param key * @ return The tag if it exists ...
if ( tagPattern != null ) { Matcher m = tagPattern . matcher ( key ) ; if ( m . find ( ) ) return m . group ( 1 ) ; } return key ;
public class MyPOSDictionary { void addTags ( String word , String ... tags ) { } }
super . addTags ( word , tags ) ; for ( String t : tags ) { knwonTags . add ( t ) ; }
public class OWLObjectPropertyDomainAxiomImpl_CustomFieldSerializer { /** * Deserializes the content of the object from the * { @ link com . google . gwt . user . client . rpc . SerializationStreamReader } . * @ param streamReader the { @ link com . google . gwt . user . client . rpc . SerializationStreamReader } t...
deserialize ( streamReader , instance ) ;
public class CmsRemovableFormRow { /** * Method to remove row . < p > */ void removeRow ( ) { } }
HasComponents parent = CmsRemovableFormRow . this . getParent ( ) ; if ( parent instanceof ComponentContainer ) { ( ( ComponentContainer ) parent ) . removeComponent ( CmsRemovableFormRow . this ) ; } if ( m_remove != null ) { m_remove . run ( ) ; }
public class UnCheckOutCommand { /** * Webdav Uncheckout method implementation . * @ param session current session * @ param path resource path * @ return the instance of javax . ws . rs . core . Response */ public Response uncheckout ( Session session , String path ) { } }
try { Node node = session . getRootNode ( ) . getNode ( TextUtil . relativizePath ( path ) ) ; Version restoreVersion = node . getBaseVersion ( ) ; node . restore ( restoreVersion , true ) ; return Response . ok ( ) . header ( HttpHeaders . CACHE_CONTROL , "no-cache" ) . build ( ) ; } catch ( UnsupportedRepositoryOpera...
public class PlayEngine { /** * Send an RTMP message * @ param messageIn * incoming RTMP message */ private void sendMessage ( RTMPMessage messageIn ) { } }
IRTMPEvent eventIn = messageIn . getBody ( ) ; IRTMPEvent event ; switch ( eventIn . getDataType ( ) ) { case Constants . TYPE_AGGREGATE : event = new Aggregate ( ( ( Aggregate ) eventIn ) . getData ( ) ) ; break ; case Constants . TYPE_AUDIO_DATA : event = new AudioData ( ( ( AudioData ) eventIn ) . getData ( ) ) ; br...
public class SassVaadinGenerator { /** * ( non - Javadoc ) * @ see * net . jawr . web . resource . bundle . generator . AbstractCachedGenerator # setConfig ( * net . jawr . web . config . JawrConfig ) */ @ Override public void setConfig ( JawrConfig config ) { } }
super . setConfig ( config ) ; String value = this . config . getProperty ( JawrConstant . SASS_GENERATOR_URL_MODE , SASS_GENERATOR_DEFAULT_URL_MODE ) ; urlMode = UrlMode . valueOf ( value . toUpperCase ( ) ) ;
public class DisconfMgrBean { /** * register aspectJ for disconf get request * @ param registry */ private void registerAspect ( BeanDefinitionRegistry registry ) { } }
GenericBeanDefinition beanDefinition = new GenericBeanDefinition ( ) ; beanDefinition . setBeanClass ( DisconfAspectJ . class ) ; beanDefinition . setLazyInit ( false ) ; beanDefinition . setAbstract ( false ) ; beanDefinition . setAutowireCandidate ( true ) ; beanDefinition . setScope ( "singleton" ) ; registry . regi...
public class Rollbar { /** * report an exception to Rollbar , specifying the level . * @ param throwable the exception that occurred . * @ param level the severity level . */ @ Deprecated public static void reportException ( final Throwable throwable , final String level ) { } }
reportException ( throwable , level , null , null ) ;
public class Util { /** * if an href with terminating " / " the name part is that between the * ending " / " and the one before . * < p > Otherwise it ' s the part after the last " / " < / p > * @ param href to split * @ return name split into path and name part */ public static String [ ] splitName ( final Str...
if ( ( href == null ) || ( href . length ( ) == 0 ) ) { return null ; } final String stripped ; if ( href . endsWith ( "/" ) ) { stripped = href . substring ( 0 , href . length ( ) - 1 ) ; } else { stripped = href ; } final int pos = stripped . lastIndexOf ( "/" ) ; if ( pos <= 0 ) { return null ; } return new String [...
public class ST_ClosestPoint { /** * Returns the 2D point on geometry A that is closest to geometry B . * @ param geomA Geometry A * @ param geomB Geometry B * @ return The 2D point on geometry A that is closest to geometry B */ public static Point closestPoint ( Geometry geomA , Geometry geomB ) { } }
if ( geomA == null || geomB == null ) { return null ; } // Return the closest point on geomA . ( We would have used index // 1 to return the closest point on geomB . ) return geomA . getFactory ( ) . createPoint ( DistanceOp . nearestPoints ( geomA , geomB ) [ 0 ] ) ;
public class FSNamesystem { /** * This is called from the ReplicationMonitor to process over * replicated blocks . */ private void processOverReplicatedBlocksAsync ( ) { } }
// blocks should not be scheduled for deletion during safemode if ( isInSafeMode ( ) ) { return ; } if ( delayOverreplicationMonitorTime > now ( ) ) { LOG . info ( "Overreplication monitor delayed for " + ( ( delayOverreplicationMonitorTime - now ( ) ) / 1000 ) + " seconds" ) ; return ; } nameNode . clearOutstandingNod...
public class PrimeConnections { /** * Prime connections , blocking until configured percentage ( default is 100 % ) of target servers are primed * or max time is reached . * @ see CommonClientConfigKey # MinPrimeConnectionsRatio * @ see CommonClientConfigKey # MaxTotalTimeToPrimeConnections */ public void primeCo...
if ( servers == null || servers . size ( ) == 0 ) { logger . debug ( "No server to prime" ) ; return ; } for ( Server server : servers ) { server . setReadyToServe ( false ) ; } int totalCount = ( int ) ( servers . size ( ) * primeRatio ) ; final CountDownLatch latch = new CountDownLatch ( totalCount ) ; final AtomicIn...
public class Postconditions { /** * < p > A version of { @ link # checkPostcondition ( boolean , String ) } that * constructs a description message from the given format string and * arguments . < / p > * < p > Note that the use of variadic arguments may entail allocating memory on * virtual machines that fail ...
checkPostconditionV ( "<unspecified>" , condition , format , objects ) ;
public class DajlabScene { /** * Create an instance of { @ link DajlabModel } containing all models from * controllers . * @ return a DajlabModel instance */ private DajlabModel getModel ( ) { } }
DajlabModel model = new DajlabModel ( ) ; for ( DajlabControllerExtensionInterface < DajlabModelInterface > controller : controllers ) { DajlabModelInterface subModel = controller . getModel ( ) ; model . put ( subModel ) ; } return model ;
public class Expression { /** * Create a negated expression to represent the negated result of the given expression . * @ param expression the expression to be negated . * @ return a negated expression . */ @ NonNull public static Expression not ( @ NonNull Expression expression ) { } }
if ( expression == null ) { throw new IllegalArgumentException ( "expression cannot be null." ) ; } return negated ( expression ) ;
public class ListDomainAssociationsResult { /** * List of Domain Associations . * @ param domainAssociations * List of Domain Associations . */ public void setDomainAssociations ( java . util . Collection < DomainAssociation > domainAssociations ) { } }
if ( domainAssociations == null ) { this . domainAssociations = null ; return ; } this . domainAssociations = new java . util . ArrayList < DomainAssociation > ( domainAssociations ) ;
public class NotesDao { /** * Retrieve all notes in the given area and feed them to the given handler . * @ see # getAll ( BoundingBox , String , Handler , int , int ) */ public void getAll ( BoundingBox bounds , Handler < Note > handler , int limit , int hideClosedNoteAfter ) { } }
getAll ( bounds , null , handler , limit , hideClosedNoteAfter ) ;
public class PropertiesEscape { /** * Perform a Java Properties Key level 1 ( only basic set ) < strong > escape < / strong > operation * on a < tt > char [ ] < / tt > input . * < em > Level 1 < / em > means this method will only escape the Java Properties Key basic escape set : * < ul > * < li > The < em > Sin...
escapePropertiesKey ( text , offset , len , writer , PropertiesKeyEscapeLevel . LEVEL_1_BASIC_ESCAPE_SET ) ;
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertWindowSpecificationRES3ToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class CreateAppRequest { /** * Tag for an Amplify App * @ param tags * Tag for an Amplify App * @ return Returns a reference to this object so that method calls can be chained together . */ public CreateAppRequest withTags ( java . util . Map < String , String > tags ) { } }
setTags ( tags ) ; return this ;
public class Matchers { /** * Equivalent of { @ code allOf ( containsString ( . . . ) , . . . ) } matcher combination * @ see org . hamcrest . Matchers # allOf ( Iterable ) * @ see org . hamcrest . Matchers # containsString ( String ) * @ param strings all the strings to match against * @ return the matcher */ ...
List < Matcher < ? super String > > matchers = new ArrayList < Matcher < ? super String > > ( ) ; for ( String string : strings ) { matchers . add ( containsString ( string ) ) ; } return allOf ( matchers ) ;
public class DraweeView { /** * Use this method only when using this class as an ordinary ImageView . * @ deprecated Use { @ link # setController ( DraweeController ) } instead . */ @ Override @ Deprecated public void setImageDrawable ( Drawable drawable ) { } }
init ( getContext ( ) ) ; mDraweeHolder . setController ( null ) ; super . setImageDrawable ( drawable ) ;
public class AbstractSecurityController { /** * Update a controlled object based on the given authorization state . * @ param controlledObject Object being controlled * @ param authorized state that has been installed on controlledObject */ protected void updateControlledObject ( Authorizable controlledObject , boo...
if ( logger . isDebugEnabled ( ) ) { logger . debug ( "setAuthorized( " + authorized + ") on: " + controlledObject ) ; } controlledObject . setAuthorized ( authorized ) ; runPostProcessorActions ( controlledObject , authorized ) ;
public class AdapterUtil { /** * Converts any generic Exception to a SQLException . * @ param ex the exception to convert . * @ return SQLException containing the original Exception class , message , and stack trace . */ public static SQLException toSQLException ( Throwable ex ) { } }
if ( ex == null ) return null ; if ( ex instanceof SQLException ) return ( SQLException ) ex ; if ( ex instanceof ResourceException ) return toSQLException ( ( ResourceException ) ex ) ; // Link the original exception to the new SQLException . SQLException sqlX = new SQLException ( ex . getClass ( ) . getName ( ) + ": ...
public class ValueDataUtil { /** * Returns < code > String < / code > value . */ public static QPath getPath ( ValueData valueData ) throws RepositoryException { } }
if ( valueData instanceof TransientValueData ) { return getPath ( ( ( TransientValueData ) valueData ) . delegate ) ; } return ( ( AbstractValueData ) valueData ) . getPath ( ) ;
public class ViewDragHelper { /** * Check if any pointer tracked in the current gesture has crossed * the required slop threshold . * < p > This depends on internal state populated by * { @ link # shouldInterceptTouchEvent ( android . view . MotionEvent ) } or * { @ link # processTouchEvent ( android . view . M...
final int count = mInitialMotionX . length ; for ( int i = 0 ; i < count ; i ++ ) { if ( checkTouchSlop ( directions , i ) ) { return true ; } } return false ;
public class ColorUtils { /** * Create a HSL color . * @ param color argb color * @ return the HSL */ static HSL toHSL ( double color ) { } }
long argb = Double . doubleToRawLongBits ( color ) ; double a = alpha ( color ) ; double r = clamp ( ( ( argb >> 32 ) & 0xFFFF ) / ( double ) 0xFF00 ) ; double g = clamp ( ( ( argb >> 16 ) & 0xFFFF ) / ( double ) 0xFF00 ) ; double b = clamp ( ( ( argb >> 0 ) & 0xFFFF ) / ( double ) 0xFF00 ) ; double max = Math . max ( ...
public class FkAgent { /** * Extract tokens from request . * @ param req Request . * @ return List of user agent tokens . * @ throws IOException If some problems inside . */ private static List < String > tokens ( final Request req ) throws IOException { } }
final List < String > tokens = new LinkedList < > ( ) ; final Iterable < String > headers = new RqHeaders . Base ( req ) . header ( "User-Agent" ) ; for ( final String header : headers ) { final Matcher matcher = PATTERN . matcher ( header ) ; if ( matcher . matches ( ) ) { tokens . add ( matcher . group ( ) ) ; } } re...
public class ServerRequest { /** * < p > Converts a { @ link JSONObject } object containing keys stored as key - value pairs into * a { @ link ServerRequest } . < / p > * @ param json A { @ link JSONObject } object containing post data stored as key - value pairs * @ param context Application context . * @ retu...
JSONObject post = null ; String requestPath = "" ; try { if ( json . has ( POST_KEY ) ) { post = json . getJSONObject ( POST_KEY ) ; } } catch ( JSONException e ) { // it ' s OK for post to be null } try { if ( json . has ( POST_PATH_KEY ) ) { requestPath = json . getString ( POST_PATH_KEY ) ; } } catch ( JSONException...
public class MathUtilities { /** * Calculate the minimum value from an array of values . * @ param values Array of values . * @ return minimum value of the provided set . */ public static BigInteger minimum ( BigInteger ... values ) { } }
int len = values . length ; if ( len == 1 ) { if ( values [ 0 ] == null ) { throw new IllegalArgumentException ( "Cannot passed null BigInteger entry to minimum()" ) ; } return values [ 0 ] ; } BigInteger current = values [ 0 ] ; for ( int i = 1 ; i < len ; i ++ ) { if ( values [ i ] == null ) { throw new IllegalArgume...
public class Hashes { /** * Preprocesses a bit vector so that MurmurHash 64 - bit can be computed in * constant time on all prefixes . * @ param bv * a bit vector . * @ param seed * a seed for the hash . * @ return an array containing the state of the variables < code > h < / code > * during the hash comp...
long h = seed , k ; long from = 0 ; final long length = bv . length ( ) ; final int wordLength = ( int ) ( length / Long . SIZE ) ; final long state [ ] = new long [ wordLength + 1 ] ; int i = 0 ; state [ i ++ ] = h ; for ( ; length - from >= Long . SIZE ; i ++ ) { k = bv . getLong ( from , from += Long . SIZE ) ; k *=...
public class PortalEventDimensionPopulatorImpl { /** * Creates a date dimension , handling the quarter and term lookup logic */ protected void createDateDimension ( List < QuarterDetail > quartersDetails , List < AcademicTermDetail > academicTermDetails , DateMidnight date ) { } }
final QuarterDetail quarterDetail = EventDateTimeUtils . findDateRangeSorted ( date , quartersDetails ) ; final AcademicTermDetail termDetail = EventDateTimeUtils . findDateRangeSorted ( date , academicTermDetails ) ; this . dateDimensionDao . createDateDimension ( date , quarterDetail . getQuarterId ( ) , termDetail !...
public class CmsFlexCacheClearDialog { /** * Creates the list of widgets for this dialog . < p > */ @ Override protected void defineWidgets ( ) { } }
setKeyPrefix ( KEY_PREFIX ) ; // initialize the cache object to use for the dialog CmsFlexController controller = ( CmsFlexController ) getJsp ( ) . getRequest ( ) . getAttribute ( CmsFlexController . ATTRIBUTE_NAME ) ; CmsFlexCache cache = controller . getCmsCache ( ) ; setOffline ( true ) ; setOnline ( true ) ; setMo...
public class HandleConstructor { /** * For each field which is not final and has no initializer that gets ' removed ' by { @ code @ Builder . Default } there is no need to * write an explicit ' this . x = foo ' in the constructor , so strip them away here . */ private static List < JavacNode > fieldsNeedingBuilderDef...
ListBuffer < JavacNode > out = new ListBuffer < JavacNode > ( ) ; top : for ( JavacNode node : typeNode . down ( ) ) { if ( node . getKind ( ) != Kind . FIELD ) continue top ; JCVariableDecl varDecl = ( JCVariableDecl ) node . get ( ) ; if ( ( varDecl . mods . flags & Flags . STATIC ) != 0 ) continue top ; for ( JavacN...
public class SystemReader { /** * Main method of the class , which handles all the process to create all * tests . * @ param storyFilePath * , it is the folder where the plain text given by the client is * stored * @ param platformName * , to choose the MAS platform ( JADE , JADEX , etc . ) * @ param src ...
/* * This map has the following structure : { Scenario1ID = > * [ GivenDescription1 , WhenDescription1 , ThenDescription1 ] , Scenario2ID * = > [ GivenDescription2 , WhenDescription2 , ThenDescription2 ] , . . . } */ HashMap < String , String [ ] > scenarios = new HashMap < String , String [ ] > ( ) ; String storyN...
public class WorkflowManagerImpl { /** * / * ( non - Javadoc ) * @ see nz . co . senanque . workflow . WorkflowManager # getField ( nz . co . senanque . workflow . instances . ProcessInstance , nz . co . senanque . schemaparser . FieldDescriptor ) */ @ Transactional public Object getField ( ProcessInstance processIns...
Object o = getContextDAO ( ) . getContext ( processInstance . getObjectInstance ( ) ) ; String prefix = "get" ; if ( fd . getType ( ) . endsWith ( "Boolean" ) ) { prefix = "is" ; } String name = prefix + StringUtils . capitalize ( fd . getName ( ) ) ; try { Method getter = o . getClass ( ) . getMethod ( name ) ; return...
public class DataStoreUtil { /** * Make a new record storage , to associate the given ids with an object of * class dataclass . * @ param ids DBIDs to store data for * @ param hints Hints for the storage manager * @ param dataclasses classes to store * @ return new record store */ public static WritableRecord...
return DataStoreFactory . FACTORY . makeRecordStorage ( ids , hints , dataclasses ) ;
public class GrailsDomainBinder { /** * Binds the sub classes of a root class using table - per - heirarchy inheritance mapping * @ param domainClass The root domain class to bind * @ param parent The parent class instance * @ param mappings The mappings instance * @ param sessionFactoryBeanName the session fac...
final java . util . Collection < PersistentEntity > subClasses = domainClass . getMappingContext ( ) . getDirectChildEntities ( domainClass ) ; for ( PersistentEntity sub : subClasses ) { final Class javaClass = sub . getJavaClass ( ) ; if ( javaClass . getSuperclass ( ) . equals ( domainClass . getJavaClass ( ) ) && C...
public class JavaWriter { /** * Prints a parameterized type declaration : * < pre > * T & lt ; X > * < / pre > */ private void printParameterizedType ( ParameterizedType parameterizedType ) throws IOException { } }
Type rawType = parameterizedType . getRawType ( ) ; if ( rawType instanceof Class < ? > ) printClass ( ( Class < ? > ) rawType ) ; else printType ( rawType ) ; print ( "<" ) ; Type [ ] typeParameters = parameterizedType . getActualTypeArguments ( ) ; for ( int i = 0 ; i < typeParameters . length ; i ++ ) { if ( i != 0 ...
public class CheckUtil { /** * Same as checkMmul , but for matrix subtraction */ public static boolean checkSubtract ( INDArray first , INDArray second , double maxRelativeDifference , double minAbsDifference ) { } }
RealMatrix rmFirst = convertToApacheMatrix ( first ) ; RealMatrix rmSecond = convertToApacheMatrix ( second ) ; INDArray result = first . sub ( second ) ; RealMatrix rmResult = rmFirst . subtract ( rmSecond ) ; if ( ! checkShape ( rmResult , result ) ) return false ; boolean ok = checkEntries ( rmResult , result , maxR...
public class GrapesServerConfig { /** * Returns the complete Grapes root URL * @ return String */ public String getUrl ( ) { } }
final StringBuilder sb = new StringBuilder ( ) ; sb . append ( "http://" ) ; sb . append ( getHttpConfiguration ( ) . getBindHost ( ) . get ( ) ) ; sb . append ( ":" ) ; sb . append ( getHttpConfiguration ( ) . getPort ( ) ) ; return sb . toString ( ) ;
public class AmazonApiGatewayClient { /** * Deletes the < a > ClientCertificate < / a > resource . * @ param deleteClientCertificateRequest * A request to delete the < a > ClientCertificate < / a > resource . * @ return Result of the DeleteClientCertificate operation returned by the service . * @ throws Unautho...
request = beforeClientExecution ( request ) ; return executeDeleteClientCertificate ( request ) ;
public class Cluster { /** * Gets the instance id . */ @ SuppressWarnings ( "WeakerAccess" ) public String getInstanceId ( ) { } }
// Constructor ensures that name is not null ClusterName fullName = Verify . verifyNotNull ( ClusterName . parse ( stateProto . getName ( ) ) , "Name can never be null" ) ; // noinspection ConstantConditions return fullName . getInstance ( ) ;
public class AnnotationUtils { /** * Helper method for comparing two arrays of annotations . * @ param a1 the first array * @ param a2 the second array * @ return a flag whether these arrays are equal */ @ GwtIncompatible ( "incompatible method" ) private static boolean annotationArrayMemberEquals ( final Annotat...
if ( a1 . length != a2 . length ) { return false ; } for ( int i = 0 ; i < a1 . length ; i ++ ) { if ( ! equals ( a1 [ i ] , a2 [ i ] ) ) { return false ; } } return true ;
public class ExtractionUtil { /** * Extracts the file contained in a gzip archive . The extracted file is * placed in the exact same path as the file specified . * @ param file the archive file * @ throws FileNotFoundException thrown if the file does not exist * @ throws IOException thrown if there is an error ...
final String originalPath = file . getPath ( ) ; final File gzip = new File ( originalPath + ".gz" ) ; if ( gzip . isFile ( ) && ! gzip . delete ( ) ) { LOGGER . debug ( "Failed to delete initial temporary file when extracting 'gz' {}" , gzip . toString ( ) ) ; gzip . deleteOnExit ( ) ; } if ( ! file . renameTo ( gzip ...
public class SDKUtil { /** * Generate parameter hash for the given chain code path , func and args * @ param path Chain code path * @ param func Chain code function name * @ param args List of arguments * @ return hash of path , func and args */ public static String generateParameterHash ( String path , String ...
logger . debug ( String . format ( "GenerateParameterHash : path=%s, func=%s, args=%s" , path , func , args ) ) ; // Append the arguments StringBuilder param = new StringBuilder ( path ) ; param . append ( func ) ; args . forEach ( param :: append ) ; // Compute the hash String strHash = Hex . toHexString ( hash ( para...
public class Filelistener { /** * Start listening to the defined folders . * @ throws FileNotFoundException * @ throws ClassNotFoundException * @ throws IOException * @ throws ResourceNotExistingException * @ throws TTException */ public void startListening ( ) throws FileNotFoundException , ClassNotFoundExce...
mProcessingThread = new Thread ( ) { public void run ( ) { try { processFileNotifications ( ) ; } catch ( InterruptedException | TTException | IOException e ) { } } } ; mProcessingThread . start ( ) ; initSessions ( ) ;
public class CheckpointStatsTracker { /** * Callback when a checkpoint fails . * @ param failed The failed checkpoint stats . */ private void reportFailedCheckpoint ( FailedCheckpointStats failed ) { } }
statsReadWriteLock . lock ( ) ; try { counts . incrementFailedCheckpoints ( ) ; history . replacePendingCheckpointById ( failed ) ; dirty = true ; } finally { statsReadWriteLock . unlock ( ) ; }
public class SettingsPack { /** * Sets a global limit on the number of connections opened . The number of * connections is set to a hard minimum of at least two per torrent , so * if you set a too low connections limit , and open too many torrents , * the limit will not be met . * @ param value */ public Settin...
sp . set_int ( settings_pack . int_types . connections_limit . swigValue ( ) , value ) ; return this ;
public class ResourceModelStatistics { /** * Adds the mapping with the duration to the statistics . * @ return this instance . */ public ResourceModelStatistics countMappingDuration ( int durationInMs ) { } }
// The right - hand interval boundaries are pre - calculated . We start at the smallest ( 1 ) of the // interval [ 0 , 1 ) . Thus , when our value is less than the boundary , we know it is in the current interval ( i ) , // as the right - hand boundary is exclusive . for ( int i = 0 ; i < this . indexBoundaries . lengt...
public class TagsApi { /** * Get the raw versions of a given tag ( or all tags ) for the currently logged - in user . * This method does not require authentication . * @ param tag tag you want to retrieve all raw versions for . Optional . * @ return raw versions of a tag for the given tag , or all tags for the cu...
Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.tags.getListUserRaw" ) ; if ( tag != null ) { params . put ( "tag" , tag ) ; } return jinx . flickrGet ( params , RawTagsForUser . class ) ;
public class ProducibleConfig { /** * Create the producible data from configurer . * @ param configurer The configurer reference ( must not be < code > null < / code > ) . * @ return The producible data . * @ throws LionEngineException If unable to read node . */ public static ProducibleConfig imports ( Configure...
Check . notNull ( configurer ) ; return imports ( configurer . getRoot ( ) ) ;